fix: Correct file download method in Convert-Files function

This commit is contained in:
Bobby Abellana (aider) 2025-02-21 10:54:58 -08:00
parent 83895edac4
commit 065a822866

View File

@ -457,7 +457,8 @@ function Convert-Files {
$downloadUri = "https://graph.microsoft.com/v1.0/drives/$($drive.Id)/root:/$($encodedPath):/content"
# Download the file
Invoke-MgGraphRequest -Uri $downloadUri -Method GET -OutFile $downloadPath
$fileContent = Invoke-MgGraphRequest -Uri $downloadUri -Method GET
[System.IO.File]::WriteAllBytes($downloadPath, $fileContent)
if (-not (Test-Path $downloadPath)) {
throw "Failed to download file from SharePoint"
}