代码拉取完成,页面将自动刷新
param(
[parameter(Mandatory=$true)]$DotnetRemotePath,
[parameter(Mandatory=$true)]$DotnetLocalPath,
[parameter(Mandatory=$true)]$DotnetPath
)
$retryCount = 0
$success = $false
do {
try {
Write-Output "Downloading from $DotnetRemotePath"
(New-Object Net.WebClient).DownloadFile($DotnetRemotePath, $DotnetLocalPath)
$success = $true
} catch {
if ($retryCount -ge 6) {
Write-Output "Maximum of 5 retries exceeded. Aborting"
throw
}
else {
$retryCount++
$retryTime = 5 * $retryCount
Write-Output "Download failed. Retrying in $retryTime seconds"
Start-Sleep -Seconds (5 * $retryCount)
}
}
} while ($success -eq $false)
Write-Output "Download finished"
Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors
if ($AddTypeErrors.Count -eq 0) {
[System.IO.Compression.ZipFile]::ExtractToDirectory($DotnetLocalPath, $DotnetPath)
}
else {
(New-Object -com shell.application).namespace($DotnetPath).CopyHere((new-object -com shell.application).namespace($DotnetLocalPath).Items(), 16)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。