Skip to content

Instantly share code, notes, and snippets.

@srkiNZ84
Created May 27, 2018 22:58
Show Gist options
  • Save srkiNZ84/f835c0038e055af61af0bcede6044b01 to your computer and use it in GitHub Desktop.
Save srkiNZ84/f835c0038e055af61af0bcede6044b01 to your computer and use it in GitHub Desktop.
Simple PowerShell script to install IIS and the AWS CodeDeploy agent on a Windows EC2 instance
<powershell>
Start-Transcript;
# Install IIS
Import-Module ServerManager;
Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName 'IIS-WebServerRole', 'IIS-WebServer', 'IIS-ManagementConsole';
# Install CodeDeploy Agent
Import-Module AWSPowerShell;
New-Item -Path "C:\Temp" -ItemType "directory" -Force;
Read-S3Object -BucketName aws-codedeploy-us-east-1 -Key latest/codedeploy-agent.msi -File c:\temp\codedeploy-agent.msi;
c:\temp\codedeploy-agent.msi /quiet /l c:\temp\host-agent-install-log.txt;
</powershell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment