Created
July 18, 2017 16:47
-
-
Save jeremygaither/4be2511fd33c0a98a6ea6104cbc0b6c8 to your computer and use it in GitHub Desktop.
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
# Set-ExecutionPolicy -ExecutionPolicy Bypass -Force | |
If (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
Write-Warning "You do not have Administrator rights to run this script!" | |
exit 1 | |
} | |
(Test-Path C:\TEMP) -or (New-Item -ItemType directory -Path C:\TEMP) | |
(Test-Path C:\TEMP\AmazonSSMAgentSetup.exe) -and (Remove-Item C:\TEMP\AmazonSSMAgentSetup.exe) | |
Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe -Outfile C:\temp\AmazonSSMAgentSetup.exe | |
Start-Process -FilePath C:\temp\AmazonSSMAgentSetup.exe -ArgumentList ALLOWEC2INSTALL=YES, /install, /passive, /norestart, /log, c:\temp\AmazonSSMAgentSetup.log -Wait -NoNewWindow | |
if ($?) { Write-Output "install ok" } | |
Restart-Service AmazonSSMAgent |
Author
jeremygaither
commented
Aug 11, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment