fix: correct folder retrieval by using DriveId and DriveItemId
This commit is contained in:
parent
d3e21955da
commit
8f9df8e97d
@ -138,9 +138,11 @@ function Get-FolderBrowser {
|
||||
throw "Library not found: $libraryName"
|
||||
}
|
||||
|
||||
# Get folders
|
||||
$folders = Get-MgDriveRoot -DriveId $drive.Id | Get-MgDriveItemChild -DriveId $drive.Id
|
||||
$folders = $folders | Where-Object { $_.Folder }
|
||||
# Get root folder first
|
||||
$root = Get-MgDriveRoot -DriveId $drive.Id
|
||||
|
||||
# Get folders using the root item's ID
|
||||
$folders = Get-MgDriveItemChild -DriveId $drive.Id -DriveItemId $root.Id | Where-Object { $_.Folder }
|
||||
|
||||
# Create custom objects for the grid view
|
||||
$folderObjects = $folders | ForEach-Object {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user