From 065a822866d4f574e63ee3a6d3ef8cfd0c4ca8cf Mon Sep 17 00:00:00 2001 From: "Bobby Abellana (aider)" Date: Fri, 21 Feb 2025 10:54:58 -0800 Subject: [PATCH] fix: Correct file download method in Convert-Files function --- SharePointFunctions.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SharePointFunctions.ps1 b/SharePointFunctions.ps1 index ced718a..fd123a2 100644 --- a/SharePointFunctions.ps1 +++ b/SharePointFunctions.ps1 @@ -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" }