התסריט הבא מוריד קבצים.
יש לרשום קישור ישיר לקובץ הרצוי, וכן שם כלשהו לרבות הסיומת הנכונה של הקובץ ( zip, exe וכיוב' ).
כך, בריבוי הורדות
יש לרשום קישור ישיר לקובץ הרצוי, וכן שם כלשהו לרבות הסיומת הנכונה של הקובץ ( zip, exe וכיוב' ).
קוד:
# Invoke-Webrequest "SomeName"
$FileName = ""
$Uri = ""
$OutputPath = Join-Path "~/Downloads" -ChildPath $FileName
$ProgressPreference = '0'
Write-Host "Downloading $FileName"
$Action = IWR -Uri $Uri -OutFile $OutputPath
GCI $OutputPath
קוד:
# Invoke-Webrequest "Multi-link"
$Combos = @(
@{
FileName = "SomeName1"
Uri = "https://...1"
}
@{
FileName = "SomeName2"
Uri = "https://...2"
}
@{
FileName = "SomeName3"
Uri = "https://...3"
}
)
foreach ($Combo in $Combos) {
$FileName = $Combo.FileName
$Uri = $Combo.Uri
$OutputPath = Join-Path "~/Downloads" -ChildPath $FileName
$ProgressPreference = '0'
Write-Host "Downloading $FileName"
$Action = IWR -Uri $Uri -OutFile $OutputPath
GCI $OutputPath
}
#
נערך לאחרונה ב: