Last active
August 27, 2018 20:26
-
-
Save Sam-Martin/a55aedce21360d08c0bbfe13deaeb639 to your computer and use it in GitHub Desktop.
Install AmazonSSM Agent Silently on 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
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