For various administrative purposes, it can be useful to download files and install via Powershell. There are a few ways to do it, but with Powershell 5.1, I’ll leverage invoke-webrequest and start-process.
In the example below, I’m downloading Windows Powershell for AWS installer, using /qn to install silently.
#create new directory for download...just because new-item "C:\download" -type directory #download file invoke-webrequest "http://sdk-for-net.amazonwebservices.com/latest/AWSToolsAndSDKForNet.msi" -outfile "C:\download\AWSToolsAndSDKForNet.msi" #run installer silently start-process -filepath "C:\download\AWSToolsAndSDKForNet.msi" -ArgumentList "/qn"
As always, don’t forge to Run As Administrator.