情况:
Get-ChildItem $Path -Filter *.dll为我工作这有效:
$Path = "$env:windir\system32\*" $GuyArray = @("*.dll", "*.exe") Get-ChildItem $Path -Include $GuyArray但我不能让这个工作:
$Path = "$env:windir\system32\*" $GuyArray = @("*.dll", "*.exe") Get-ChildItem $Path -Filter $GuyArray
错误信息:
无法将“System.Object[]”转换为参数“Filter”所需的类型“System.String”。不支持指定的方法。
问题:
- 这是否意味着
-Include支持多个值,但-Filter只允许一个值? - 如果上述解释是正确的,有没有办法我可以从中发现这一点
Get-Help gci?