Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $strBase = "http://url/download/"
- $strFileBase = "filename"
- $aExtensions = ".exe",".aaa",".bbb",".ccc"
- foreach ($ext in $aExtensions)
- {
- try
- {
- $a = Invoke-WebRequest -Uri $($strBase + $strFileBase + $ext) -OutFile $($strFileBase + $ext)
- write-host $strBase$strFileBase$ext "downloaded to" $strFileBase$ext
- }
- catch
- {
- $strBase + $strFileBase + $ext + " doesn't exist on server."
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement