我運行此PowerShell腳本,並且它在PowerShell 4.0上正常工作。但是我現在有PowerShell的5.0和腳本的工作,但它拋出一個錯誤:測試路徑移動 - 項目問題
腳本:
$path = "X"
$destination = "Y"
while (Test-Path -Path $path) {
Move-Item -Path "$path\*zip" -Destination "$destination"
}
我得到的錯誤是:
Move-Item : The process cannot access the file because it is being used by another process.