Steps to reproduce
Set-Location ~
Get-ChildItem . -Depth 0 | Measure-Object
Get-ChildItem . -Depth 0 -Include * | Measure-Object
Get-ChildItem . -Depth 0 -Exclude NoSuchItemImSure | Measure-Object
Expected behavior
All 3 commands should output the same number - the count of items in the current dir.
Actual behavior
-
The 1st command reports the number of items in the current directory only.
-
The 2nd and 3rd commands unexpectedly traverse the entire subtree, ignoring -Depth 0.
Environment data
PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on macOS 10.12.4
PowerShell Core v6.0.0-alpha (v6.0.0-alpha.18) on Microsoft Windows 10 Pro (64-bit; v10.0.14393)
Steps to reproduce
Expected behavior
All 3 commands should output the same number - the count of items in the current dir.
Actual behavior
The 1st command reports the number of items in the current directory only.
The 2nd and 3rd commands unexpectedly traverse the entire subtree, ignoring
-Depth 0.Environment data