The below PowerShell script will demonstrate how to download and unzip files to specific directory.

#!powershell

# Setup Key Values
###################################
$URL=”http://yourserver//yourzipfilename.zip”
$downloadtargetpath= “C:\temp\yourzipfilename.zip”
$unziptargetpath= “C:\temp”

# Forece TLS 1.2
###################################[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

# Download the script to C:\temp Directory
###########################################
write-host ” ”
write-host “Download the zip file from: $URL” -ForegroundColor Yellow
write-host ” ”

Invoke-WebRequest -UseBasicParsing $URL -OutFile $downloadtargetpath -ErrorAction Stop

# Unzip the file
###########################################
write-host ” ”
write-host “unzipping $downloadtargetpath” -ForegroundColor Yellow
write-host ” ”

Expand-Archive -LiteralPath $downloadtargetpath -DestinationPath $unziptargetpath