You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get-ChildItem -Recurse shouldn't quietly ignore -Include and -Exclude when -LiteralPath is used instead of -Path #3730
Even without using wildcards, Get-ChildItem -Recurse allows matching items on every level of the target hierarchy, possibly filtered with -Include and -Exclude.
However, if you use -LiteralPath rather than the (implied) -Path parameter, -Include and -Exclude are quietly ignored:
If there's a good reason for this behavior (none that I'm aware of), then at the very least a warning about -Include / -Exclude getting ignored should be issued, or a separate parameter set should prevent combining -LiteralPath with -Include / -Exclude.
Both calls should yield no output, because all items should be excluded by virtue of -Exclude *.
Actual behavior
The 2nd command, due to -Exclude * getting ignored, outputs the entire subtree of $PSHOME.
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)
Activity
SteveL-MSFT commentedon Nov 1, 2017
This appears to be a regression from v5 (repros with v5.1)
nightroman commentedon Nov 1, 2017
From my observations,
-Includeworked as expected in PS v5 Preview. So something changed exactly in v5 Preview -> v5 RTM.I have no data about
-Exclude(i.e. regression or not).