Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install latest version of AWS CLI via PowerShell
# https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html
$dlurl = "https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
$env:Path += ";C:\Program Files\Amazon\AWSCLI\bin"
@olen2006
Copy link

olen2006 commented Mar 16, 2020

Nice

@sanketgund07
Copy link

sanketgund07 commented Apr 21, 2020

Awesome. thanks

@AlejandroBohal
Copy link

AlejandroBohal commented Mar 24, 2021

Thank you brocoli

@lomungo
Copy link

lomungo commented Apr 3, 2021

Great Thanks. Maybe add
$env:Path += ";C:\Program Files\Amazon\AWSCLI\bin"

@dansmith65
Copy link
Author

dansmith65 commented Apr 6, 2021

Great Thanks. Maybe add
$env:Path += ";C:\Program Files\Amazon\AWSCLI\bin"

@lomungo Thanks, I just added it.

@tylergohl
Copy link

tylergohl commented Oct 22, 2021

Adding $ProgressPreference = 'SilentlyContinue' to the beginning of the script can help download times a LOT if you are accessing the host through RDP etc

@fabiopaiva
Copy link

fabiopaiva commented Feb 11, 2022

V2

$dlurl = "https://awscli.amazonaws.com/AWSCLIV2.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
$env:Path += ";C:\Program Files\Amazon\AWSCLIV2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment