This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# turn off ie security | |
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" | |
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" | |
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 | |
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 | |
# priority to programs, not background | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl" -Name "Win32PrioritySeparation" -Value 38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Scan for available updates | |
function Get-AvailableUpdates { | |
[CmdletBinding()] | |
param() | |
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession | |
$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=0";OnlineScan=$true} | |
$result.Updates | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$ScriptPath | |
) | |
# Formats the Script to you can paste it into a RunCommand or Automation Document | |
# Example: | |
# .\AdditionalExamples\Format-PSForDocument.ps1 -ScriptPath .\AdditionalExamples\Install-SSMS.ps1 | |
# Grab the script and remove blank lines and comments | |
$powershell = (Get-Content $ScriptPath | Where-Object {$_ -notlike '#*' -and $_ -notlike [string]::Empty}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$path = $env:TEMP; $arg="/silent /install"; $exe = "chrome_installer.exe"; $url="https://dl.google.com/chrome/install/latest/$exe"; Invoke-WebRequest $url -OutFile $path$exe; Start-Process -FilePath $path$exe -Args $arg -Verb RunAs -Wait; Remove-Item $path$exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instal IIS | |
Install-WindowsFeature -name Web-Server -IncludeManagementTools | |
# Install .Net | |
Install-WindowsFeature Net-Framework-Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module AWSPowerShell | |
Function Get-MetaData { | |
<# | |
.DESCRIPTION | |
Gets metadata from the local instance using the path extention provided | |
.PARAMETER metaDataUrlPathExtention | |
The URL suffix of the metadata that you want to gathered | |
.EXAMPLE | |
[string]$instanceId = $(Get-MetaDataObject -metaDataUrlPathExtention "instance-id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script installs Visual Studio Code Silently. | |
.DESCRIPTION | |
The script downloads the latest VSCode installer and performs a silent installation. | |
.NOTES | |
Run this script on a Windows Server instance. | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(Get-CimInstance -ClassName Win32_OperatingSystem).OperatingSystemSKU | |
#region Nano server check | |
Switch -Exact ($(Get-CimInstance -ClassName Win32_OperatingSystem).OperatingSystemSKU) { | |
143 { | |
Write-Verbose -Message 'Script Running on Windows Server Datacenter Edition (Nano Server installation)' | |
break; | |
} | |
144 { | |
Write-Verbose -Message 'Windows Server Standard Edition (Nano Server installation)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "Installed Updates" | |
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession | |
$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=1";OnlineScan=$true} | |
$result.Updates | |
Write-Host "Missing Updates" | |
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell to grab a list of the Windows 2016 with Containers AMI | |
Get-EC2Image -Filter @{Name='name';Value='Windows_Server-2016*'},@{Name='name';Value="*Containers*"} |
NewerOlder