Last active
January 27, 2021 20:55
-
-
Save sheldonhull/c2740d00c1858c4c53b0ccb0231d2126 to your computer and use it in GitHub Desktop.
[Install SSM Agent Manually on Windows] #aws #powershell #windows
This file contains hidden or 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
| # https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html | |
| $ProgressPreference = 'SilentlyContinue' | |
| Write-Host 'Downloading installer' | |
| $InstallerFile = Join-Path $env:USERPROFILE 'Downloads\SSMAgent_latest.exe' | |
| $invokeWebRequestSplat = @{ | |
| Uri = 'https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe' | |
| OutFile = $InstallerFile | |
| } | |
| Invoke-WebRequest @invokeWebRequestSplat | |
| Write-Host 'Installing SSM Agent' | |
| $startProcessSplat = @{ | |
| FilePath = $InstallerFile | |
| ArgumentList = '/S' | |
| } | |
| Start-Process @startProcessSplat | |
| Write-Host 'Cleaning up ssmagent download' | |
| Remove-Item $InstallerFile -Force | |
| Restart-Service AmazonSSMAgent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment