Skip to content

Instantly share code, notes, and snippets.

@sheldonhull
Last active January 27, 2021 20:55
Show Gist options
  • Select an option

  • Save sheldonhull/c2740d00c1858c4c53b0ccb0231d2126 to your computer and use it in GitHub Desktop.

Select an option

Save sheldonhull/c2740d00c1858c4c53b0ccb0231d2126 to your computer and use it in GitHub Desktop.
[Install SSM Agent Manually on Windows] #aws #powershell #windows
# 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