我运行此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.