누구든지 나를 도와 줄 수 있는지 궁금합니다. 나는 서비스를 중지하려면이 문을 가지고 있지만 내가 시작 슬립 내가 후 루프를 중지 카운터를 추가 할 5PowerShell - while 루프에 카운터 추가
while($module | Get-Service | ? {$_.Status -eq "Running" -or $_.Status -eq "Stopping"})
{
set-service $module -ComputerName $targetserver -StartupType Disabled -Status Stopped -PassThru
;
Start-Sleep -Seconds 5 #keep repeating stop services every 5 seconds until all services have stopped
}
을 -s 추가하므로 시간에 서비스 때로는 종속성으로 인해 멈추지 않는다 60 초, 서비스가 계속 실행중인 경우 write-host
r n "Service not stopped."
도움을 주시면 감사하겠습니다. 모두에게 감사드립니다.
시간 .com/questions/3513650/timing-a-commands-in-powershell) – gravity