我有两个脚本应该执行相同的操作,但第一个脚本不起作用,第二个脚本起作用。这是为什么?我设法弄清楚它与排除有关。它说:
Move-Item : Cannot move item because the item at 'E:\hudba\test.ps1' does not exist. At line:1 char:1 + Move-Item "E:\test\*" "E:\ ... + CategoryInfo : InvalidOperation: (:) [Move-Item], PSInvalidOperationException + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.MoveItemCommand
脚本
Move-Item "E:\test\*" "E:\test2" -Exclude "*.ps1"
Get-ChildItem -Path "E:\test\*" -Recurse -Exclude "*.ps1" | Move-Item -Destination "E:\test2"
谢谢:)
最佳答案
这是一个已知问题,预计 v6 会修复
关于powershell - 带排除的移动项目不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43576281/