Skip to content

Commit

Permalink
Update Invoke-AzureStorageBlobUploadFinalize.ps1
Browse files Browse the repository at this point in the history
Applied this fix: MSEndpointMgr#155 (comment)
  • Loading branch information
wasbeer authored May 25, 2024
1 parent 1786bb0 commit 6251767
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Private/Invoke-AzureStorageBlobUploadFinalize.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ function Invoke-AzureStorageBlobUploadFinalize {
$XML += "<Latest>$($Chunk)</Latest>"
}
$XML += '</BlockList>'


$Headers = @{
"content-type" = "text/plain; charset=iso-8859-1"
}
try {
$WebResponse = Invoke-RestMethod -Uri $Uri -Method "Put" -Body $XML -ErrorAction Stop
$WebResponse = Invoke-RestMethod -Uri $Uri -Method "Put" -Headers $Headers -Body $XML -ErrorAction Stop
}
catch {
Write-Warning -Message "Failed to finalize Azure Storage blob upload. Error message: $($_.Exception.Message)"
}
}
}

0 comments on commit 6251767

Please sign in to comment.