Skip to content
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

Get-GSDriveFileList -Recurse doesn't always recurse #308

Open
FISHMANPET opened this issue Jul 24, 2020 · 0 comments
Open

Get-GSDriveFileList -Recurse doesn't always recurse #308

FISHMANPET opened this issue Jul 24, 2020 · 0 comments
Assignees

Comments

@FISHMANPET
Copy link
Collaborator

The recurse flag works by looking at all the folders returned from the original query, and then recurses into them without the original query string. This would work if you just wanted all the files in a directory and ran the command without a filter. However if you're running it with a filter that doesn't include mimeType = 'application/vnd.google-apps.folder' your original query won't return any folders, and there won't be anything to for it to recurse through.

I tagged this as both a bug and an enhancement. I'm guessing based on the existing logic, the use case you envisioned was getting every file in a directory structure. In that case, I would say specifying a Filter with -Recurse isn't a supported use case, and the bug is in allowing both of those parameters to be used together. The Bugfix for that would be to setup parameter sets so they can't be used together.

However, my use case is looking for a specific file somewhere in a tree structure, and that's where the enhancement would come in. What I'm thinking is if both a filter and -Recurse is specified, run two searches, one with the filter on the parent and another to get all the folders within the parent. For every returned folder, basically do the same thing. Run the original query against that folder, plus run another query to get all the folders in that folder.

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

No branches or pull requests

1 participant