fix: Properly escape URI and improve Load-Config error message
This commit is contained in:
parent
3a2cb289db
commit
728ce14af4
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user