Skip to content

Commit

Permalink
Merge pull request majkinetor#165 from jack1142/jack1142-patch-1
Browse files Browse the repository at this point in the history
Add support for headers in Get-RemoteChecksum
  • Loading branch information
majkinetor authored Sep 12, 2018
2 parents f680fe1 + acedf55 commit 3128525
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 3128525

Please sign in to comment.