We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32472e8 commit 5291acfCopy full SHA for 5291acf
Install-DbaSSMS.ps1
@@ -94,7 +94,14 @@ function Install-DbaSSMS {
94
$OutputFile
95
)
96
if ($PSCmdlet.ShouldProcess("$ENV:COMPUTERNAME", "Downloading file from $url to $outputFile ")) {
97
- (New-Object System.Net.WebClient).DownloadFile($url, $outputFile)
+ try {
98
+ (New-Object System.Net.WebClient).DownloadFile($url, $outputFile)
99
+ }
100
+ Catch {
101
+ $pscmdlet.WriteVerbose("Probably using a proxy for internet access, trying default proxy settings")
102
+ $wc = (New-Object System.Net.WebClient).Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
103
+ $wc.DownloadFile($url, $outputFile)
104
105
}
106
107
0 commit comments