Download and Install Applications from the Web with Powershell

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 "" -outfile "C:\download\AWSToolsAndSDKForNet.msi"

#run installer silently
start-process -filepath "C:\download\AWSToolsAndSDKForNet.msi" -ArgumentList "/qn"

As always, don’t forget to Run As Administrator.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s