1 Star 0 Fork 0

1184424167/coreclr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
dotnet-download.ps1 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
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)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangrong/coreclr.git
git@gitee.com:zhangrong/coreclr.git
zhangrong
coreclr
coreclr
master

搜索帮助