Last active
September 12, 2023 10:49
-
-
Save artemkozlenkov/5513eedcaee5570782e2e523bec5a983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@' | |
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