如何在大部分用户登录完成之前创建延迟?
这应该延迟大约3分钟,但是延迟34秒。
$zprotime = 80
$zdisk = 1600
$zprocess = 60000
while (($zprotime -gt 16) -or ($zdisk -gt 72) -or ($zprocess -gt 32000)) {
$zprotime = Get-Counter '\Processor Information(_total)\% Processor Time' |
ForEach-Object {$_.CounterSamples[0].CookedValue}
$zdisk = Get-Counter '\PhysicalDisk(0 C: D: E: F: G:)\Disk Transfers/sec' |
ForEach-Object {$_.CounterSamples[0].CookedValue}
$zprocess = Get-Counter '\Process(_total)\IO Data Operations/sec' |
ForEach-Object {$_.CounterSamples[0].CookedValue}
}
exit