我有一个Windows MSC(Microsoft管理控制台),应该在30分钟后结束,因为主内存与插件非常高。
它是如何工作的?
$p = Start-Process mmc -PassThru;
$time = ( Get-Date ).AddMinutes( 30 );
while ( $true )
{
Start-Sleep -Seconds 3; #or Millseconds
if ( $time -lt ( Get-Date ) )
{
if ( -not $p.HasExited )
{
$p.Kill();
}
break;
}
}
谢谢评论。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句