-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Adding -Name to Get-ChildItem -Recurse quietly ignores directories it isn't permitted to list #9122
Copy link
Copy link
Closed
Labels
Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Metadata
Metadata
Assignees
Labels
Area-FileSystem-Providerspecific to the FileSystem providerspecific to the FileSystem providerIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
The inability to list a child directory's contents due to lack of permission correctly results in a (non-terminating) error when using
Get-ChildItem -Recurse.Simply adding
-Nameto change from outputting filesystem-info objects to strings unexpectedly causes these errors to be suppressed.Steps to reproduce (on Windows)
Run the following Pester test:
Expected behavior
Both tests should pass.
Actual behavior
That is, adding
-Namecaused the inability to list the contents ofsomeUnlistableDirto be quietly ignored.Environment data