[CmdletBinding()] param( [Parameter(Mandatory=$true, HelpMessage='URL of to download')] [ValidateNotNullOrEmpty()] [string] $url, [Parameter(Mandatory=$true, HelpMessage='Save to filename')] [ValidateNotNullOrEmpty()] [string] $saveAsFilename) $toFilename = "$PSScriptRoot\$saveAsFilename" Write-Output "Downloading '$url' to '$toFilename'..." Invoke-WebRequest -uri $url -outfile $toFilename Write-Output "Downloaded."