Internet explorer 使用Powershell杀死所有已运行5分钟以上的Internet Explorer进程

Internet explorer 使用Powershell杀死所有已运行5分钟以上的Internet Explorer进程,internet-explorer,powershell,process,kill,Internet Explorer,Powershell,Process,Kill,我想杀死所有运行超过5分钟的Internet Explorer进程。这必须是使用Powershell v1.0的一行命令。至少Powershell v2以下命令应停止超过5分钟的所有IE进程: Get-Process | select -Property ProcessName, StartTime | ? { (($_.StartTime -ne $null) -and (([DateTime]::Now - $_.StartTime).TotalMinut

我想杀死所有运行超过5分钟的Internet Explorer进程。这必须是使用Powershell v1.0的一行命令。

至少Powershell v2以下命令应停止超过5分钟的所有IE进程:

Get-Process | 
    select -Property ProcessName, StartTime |
    ? { (($_.StartTime -ne $null) -and
         (([DateTime]::Now - $_.StartTime).TotalMinutes -ge 5) -and
         ($_.ProcessName -eq "iexplore")) } |
    Stop-Process
另一种方式:

 get-process iexplore | ? { ([DateTime]::Now - $_.StartTime).TotalSeconds -gt 300 } | stop-process

如果您只想删除CPU使用率高的第一个进程:

get-process iexplore | sort –descending cpu | select –First 1 | stop-process

这确实回答了问题!
get-process iexplore | sort –descending cpu | select –First 1 | stop-process