From 728ce14af4873fd2bc9ceae2d17ddc75d272f2f5 Mon Sep 17 00:00:00 2001 From: "Bobby Abellana (aider)" Date: Fri, 21 Feb 2025 10:49:18 -0800 Subject: [PATCH] fix: Properly escape URI and improve Load-Config error message --- SharePointFunctions.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharePointFunctions.ps1 b/SharePointFunctions.ps1 index 5b2f8b0..9a01f37 100644 --- a/SharePointFunctions.ps1 +++ b/SharePointFunctions.ps1 @@ -8,7 +8,7 @@ function Load-Config { $script:config = Get-Content $configPath -Raw | ConvertFrom-Json return $true } else { - $script:txtStatus.Text += "Error loading configuration: $($_.Exception.Message)`n" + $script:txtStatus.Text += "Error loading configuration: Config file not found`n" return $false } } @@ -477,7 +477,7 @@ function Convert-Files { try { # Get the Drive ID and destination folder $destinationFolder = $script:txtTempLib.Text - $uploadUri = "https://graph.microsoft.com/v1.0/drives/$driveId/root:/$destinationFolder/$xlsxFileName:/content" + $uploadUri = "https://graph.microsoft.com/v1.0/drives/$driveId/root:/$($destinationFolder)/$($xlsxFileName):/content" # Read the file content $fileContent = [System.IO.File]::ReadAllBytes($xlsxPath)