fix: Correct folder path resolution in List-XlsFiles function
This commit is contained in:
parent
c955fed489
commit
4a3c1bb26e
@ -71,7 +71,9 @@ function List-XlsFiles {
|
|||||||
$script:txtStatus.Text += "Searching in folder: $folderPath`n"
|
$script:txtStatus.Text += "Searching in folder: $folderPath`n"
|
||||||
# Get the folder ID first
|
# Get the folder ID first
|
||||||
# Construct the correct URI for the folder
|
# Construct the correct URI for the folder
|
||||||
$folderUri = "https://graph.microsoft.com/v1.0/drives/$($drive.Id)/root:$($folderPath)"
|
# Remove the /sites/tax/Shared Documents part from the folder path
|
||||||
|
$relativePath = $folderPath.Replace("/sites/tax/Shared Documents/", "")
|
||||||
|
$folderUri = "https://graph.microsoft.com/v1.0/drives/$($drive.Id)/root:$($relativePath)"
|
||||||
$script:txtStatus.Text += "Folder URI: $folderUri`n"
|
$script:txtStatus.Text += "Folder URI: $folderUri`n"
|
||||||
try {
|
try {
|
||||||
$folderItem = Invoke-MgGraphRequest -Method GET -Uri $folderUri -ErrorAction Stop
|
$folderItem = Invoke-MgGraphRequest -Method GET -Uri $folderUri -ErrorAction Stop
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user