我有两个脚本应该做同样但第一个不起作用,第二个不起作用。这是为什么?我已经设法弄清楚它与Execlude有关。它说:
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"
谢谢:)