Process 无法停止进程
下面的ps1完全符合我的要求,只是我不知道如何终止进程。如有任何建议,将不胜感激Process 无法停止进程,process,terminate,Process,Terminate,下面的ps1完全符合我的要求,只是我不知道如何终止进程。如有任何建议,将不胜感激 while($true) { $path = "C:\Users\my\Desktop\TimeSheet.accdb" $ProcessInfo = get-process | where-object {$_.Path -eq $path }| select CommandLine | Out-String -width 200 if ($processInfo -NotLike
while($true) {
$path = "C:\Users\my\Desktop\TimeSheet.accdb"
$ProcessInfo = get-process | where-object {$_.Path -eq
$path }| select CommandLine | Out-String -width 200
if ($processInfo -NotLike "C:\Users\my\Desktop\TimeSheet.accdb") {
Start-Process -filepath "C:\Users\my\Desktop\TimeSheet.accdb"
}
else {
Write-Host ' still running '
}
Start-Sleep -Seconds 60
}