Fix content upload at powershell 7.4+
This commit is contained in:
@@ -521,6 +521,13 @@ function Write-AzureStorageChunk
|
|||||||
"Content-Type" = "application/octet-stream"
|
"Content-Type" = "application/octet-stream"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# In PowerShell (Core) 7 v7.4+, the web cmdlets (Invoke-WebRequest, Invoke-RestMethod)
|
||||||
|
# consistently encode text-based request bodies as UTF-8, unless explicitly specified otherwise.
|
||||||
|
if ($PSVersionTable.PSVersion -ge [Version]"7.4")
|
||||||
|
{
|
||||||
|
$headers["Content-Type"] += "; charset=iso-8859-1"
|
||||||
|
}
|
||||||
|
|
||||||
$curProgressPreference = $ProgressPreference
|
$curProgressPreference = $ProgressPreference
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user