Commands for installing AWS Command Line Interface without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id Amazon.AWSCLI -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Amazon.AWSCLI -e --silentwinget uninstall --id Amazon.AWSCLI -e --silentBy installer
64-bit · MSI · Current user
Silent install
msiexec /i AWSCLIV2-2.38.6.msi /qn /norestartWrite a log
msiexec /i AWSCLIV2-2.38.6.msi /qn /norestart /l*v "%TEMP%\aws-command-line-interface-install.log"Uninstall
msiexec /x {17068BB5-8533-431B-9753-82BC54811515} /qn /norestart- MSI product code
- {17068BB5-8533-431B-9753-82BC54811515}
- Uninstall registry key
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{17068BB5-8533-431B-9753-82BC54811515}
- UpgradeCode
- {E1C1971C-384E-4D6D-8D02-F1AC48281CF8}
- Install folder
- %LocalAppData%\Programs\Amazon\AWSCLIV2
64-bit · MSI · All users
Silent install
msiexec /i AWSCLIV2-2.38.6.msi /qn /norestartWrite a log
msiexec /i AWSCLIV2-2.38.6.msi /qn /norestart /l*v "%TEMP%\aws-command-line-interface-install.log"Uninstall
msiexec /x {17068BB5-8533-431B-9753-82BC54811515} /qn /norestart- MSI product code
- {17068BB5-8533-431B-9753-82BC54811515}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{17068BB5-8533-431B-9753-82BC54811515}
- UpgradeCode
- {E1C1971C-384E-4D6D-8D02-F1AC48281CF8}
- Install folder
- %ProgramFiles%\Amazon\AWSCLIV2
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-aws-command-line-interface.ps1
$url = 'https://awscli.amazonaws.com/AWSCLIV2-2.38.6.msi'
$sha256 = 'D954D0A917B486E0D68C357AB6CAA24A930573F12849B5F6770347B7A7DB1353'
$file = Join-Path $env:TEMP 'AWSCLIV2-2.38.6.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-aws-command-line-interface.ps1
$url = 'https://awscli.amazonaws.com/AWSCLIV2-2.38.6.msi'
$sha256 = 'D954D0A917B486E0D68C357AB6CAA24A930573F12849B5F6770347B7A7DB1353'
$file = Join-Path $env:TEMP 'AWSCLIV2-2.38.6.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait