Skip to content

Latest commit

 

History

History

Missing-path-and-Recurse

Get-ChildItem -Recurse and missing -Path unexpected search

When Get-ChildItem -Recurse is invoked in v3+ with a path that does not exist, it searches for all files and directories with the specified name instead.

As a result of this feature, one may get some unexpected items back, see test3.unexpected.something.ps1. Or there may be serious performances issues, see test4.takes.ages.gets.nothing.ps1, unexpected returned items are also possible.

Workarounds

  • Use the parameter LiteralPath.
  • Test paths before using with the parameter Path.

Scripts