小编Mar*_*ser的帖子

Powershell 5 Get-ChildItem LiteralPath不再适用于Include

现在我使用PowerShell 5.0.10586.0更新到Windows 10 TH2 Build 10586

现在我遇到了Get-ChildItem的问题

$files = Get-ChildItem -LiteralPath $path -Force -Recurse -Include *.txt
Run Code Online (Sandbox Code Playgroud)

这将返回$ path中的所有文件,即使它们不是.txt.这在更新之前有效.当我改为

$files = Get-ChildItem -Path $path -Force -Recurse -Include *.txt
Run Code Online (Sandbox Code Playgroud)

它又有效了.但这不是我想要的.这是一个错误还是我做错了什么?

powershell powershell-5.0

8
推荐指数
1
解决办法
1666
查看次数

标签 统计

powershell ×1

powershell-5.0 ×1