Powershell -Filter没有按预期工作

时间:2013-09-05 11:16:14

标签: powershell

以下过滤器是为了确保仅检查.properties文件,但是正在检查其他文件,例如.sh。任何人都可以在我的过滤器中看到错误吗?

Get-ChildItem -Path $directoryToTarget -Filter "*.properties" -Recurse | where { !$_.PSIsContainer } | % { 

谢谢!

1 个答案:

答案 0 :(得分:1)

我想你想要 - 包括:

Get-ChildItem -Path $directoryToTarget -Include *.properties -Recurse | where { !$_.PSIsContainer } | % {