Skip to content

Instantly share code, notes, and snippets.

@artemkozlenkov
Last active September 12, 2023 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artemkozlenkov/5513eedcaee5570782e2e523bec5a983 to your computer and use it in GitHub Desktop.
Save artemkozlenkov/5513eedcaee5570782e2e523bec5a983 to your computer and use it in GitHub Desktop.
@'
param (
[string]$Url,
[string]$OutputFileName
)
if (-not $Url) {
Write-Host "Please provide a URL using -Url parameter."
exit 1
}
if (-not $OutputFileName) {
Write-Host "Please provide an output file name using -OutputFileName parameter."
exit 1
}
Invoke-WebRequest -Uri $Url -OutFile $OutputFileName
'@ | Set-Content -Path "download.ps1"
& .\download.ps1 -Url "URL_of_the_file" -OutputFileName "desired_filename.ext"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment