Skip to content

get-mgDriveItem The request is malformed or incorrect. #813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
russgove opened this issue Aug 9, 2021 · 3 comments · Fixed by #1324
Closed

get-mgDriveItem The request is malformed or incorrect. #813

russgove opened this issue Aug 9, 2021 · 3 comments · Fixed by #1324

Comments

@russgove
Copy link

russgove commented Aug 9, 2021

When I call Get-MGDriveItem with a valid ID I get the following error:

Get-MgDriveItem : The request is malformed or incorrect.

Tried calling with the -all param too and i got the same error

Any samples on how to use this?

AB#10584

@ghost ghost added the ToTriage label Aug 9, 2021
@russgove
Copy link
Author

russgove commented Aug 9, 2021

How do i get a list of DriveItems in a Drive

@peombwa peombwa self-assigned this Aug 10, 2021
@ghost ghost removed the ToTriage label Aug 10, 2021
@helloitsliam
Copy link

Also checking in on this one. I get the same issue when executing the following:

$drive = Get-MgDrive -Top 1
Get-MgDriveItem -DriveId $drive.Id

Thanks

@peombwa
Copy link
Member

peombwa commented May 10, 2022

Thanks for bringing this to our attention. The right API to use is https://docs.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http#list-children-in-the-root-of-the-current-users-drive, which unfortunately is not currently covered by the SDK.

A workaround is to use Invoke-MgGraphRequest to make the request as we work on making the command available in the next release.

 Invoke-MgGraphRequest -Uri "v1.0/drives/$DriveId/root/children"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants