Skip to content

Instantly share code, notes, and snippets.

@Sam-Martin
Last active August 27, 2018 20:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sam-Martin/a55aedce21360d08c0bbfe13deaeb639 to your computer and use it in GitHub Desktop.
Save Sam-Martin/a55aedce21360d08c0bbfe13deaeb639 to your computer and use it in GitHub Desktop.
Install AmazonSSM Agent Silently on Windows
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Unzip
{
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-downloads-windows/EC2Config/EC2Install.zip -UseBasicParsing -OutFile "$env:temp\EC2Install.zip"
Unzip "$env:temp\EC2Install.zip" "$env:temp\EC2Install"
&"$env:temp\EC2Install\EC2Install.exe" /install /quiet /norestart
while(!(get-service AmazonSSMAgent -EA SilentlyContinue)){
start-sleep -s 5
}
gc C:\ProgramData\Amazon\SSM\Logs\amazon-ssm-agent.log -wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment