Skip to content

Commit

Permalink
Added Download-File function
Browse files Browse the repository at this point in the history
This should help those who are building behind a corporate proxy or similar.
  • Loading branch information
MartiUK committed Oct 13, 2015
1 parent 2a26026 commit d654a53
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,18 @@ function Register-Cmder(){
New-Item -Path "HKCR:\Directory\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
}
}

function Download-File {
[CmdletBinding()]
param (
[string]$Url,
[string]$File
)
begin {
$wc = new-object System.Net.WebClient
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
}
process {
$wc.DownloadFile($Url, $File)
}
}

0 comments on commit d654a53

Please sign in to comment.