2 [parameter(Mandatory=$true)]$DotnetRemotePath,
3 [parameter(Mandatory=$true)]$DotnetLocalPath,
4 [parameter(Mandatory=$true)]$DotnetPath
12 Write-Output "Downloading from $DotnetRemotePath"
13 (New-Object Net.WebClient).DownloadFile($DotnetRemotePath, $DotnetLocalPath)
16 if ($retryCount -ge 6) {
17 Write-Output "Maximum of 5 retries exceeded. Aborting"
22 $retryTime = 5 * $retryCount
23 Write-Output "Download failed. Retrying in $retryTime seconds"
24 Start-Sleep -Seconds (5 * $retryCount)
27 } while ($success -eq $false)
29 Write-Output "Download finished"
30 Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors
32 if ($AddTypeErrors.Count -eq 0) {
33 [System.IO.Compression.ZipFile]::ExtractToDirectory($DotnetLocalPath, $DotnetPath)
36 (New-Object -com shell.application).namespace($DotnetPath).CopyHere((new-object -com shell.application).namespace($DotnetLocalPath).Items(), 16)