Skip to content

Commit

Permalink
Add support for headers in Get-RemoteChecksum
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen authored Sep 11, 2018
1 parent 1cb5586 commit acedf55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AU/Public/Get-RemoteChecksum.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
Download file from internet and calculate its checksum
#>
function Get-RemoteChecksum( [string] $Url, $Algorithm='sha256' ) {
function Get-RemoteChecksum( [string] $Url, $Algorithm='sha256', $Headers ) {
$fn = [System.IO.Path]::GetTempFileName()
Invoke-WebRequest $Url -OutFile $fn -UseBasicParsing
Invoke-WebRequest $Url -OutFile $fn -UseBasicParsing -Headers $Headers
$res = Get-FileHash $fn -Algorithm $Algorithm | % Hash
rm $fn -ea ignore
return $res.ToLower()
Expand Down

0 comments on commit acedf55

Please sign in to comment.