fix: Use -OutputFilePath for binary downloads in Convert-Files
This commit is contained in:
parent
065a822866
commit
c6c0769384
@ -457,8 +457,7 @@ function Convert-Files {
|
|||||||
$downloadUri = "https://graph.microsoft.com/v1.0/drives/$($drive.Id)/root:/$($encodedPath):/content"
|
$downloadUri = "https://graph.microsoft.com/v1.0/drives/$($drive.Id)/root:/$($encodedPath):/content"
|
||||||
|
|
||||||
# Download the file
|
# Download the file
|
||||||
$fileContent = Invoke-MgGraphRequest -Uri $downloadUri -Method GET
|
Invoke-MgGraphRequest -Uri $downloadUri -Method GET -OutputFilePath $downloadPath
|
||||||
[System.IO.File]::WriteAllBytes($downloadPath, $fileContent)
|
|
||||||
if (-not (Test-Path $downloadPath)) {
|
if (-not (Test-Path $downloadPath)) {
|
||||||
throw "Failed to download file from SharePoint"
|
throw "Failed to download file from SharePoint"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user