Created
August 20, 2016 23:40
-
-
Save ericdorsey/60e99db42ade0fa13c03f83ee11ceb19 to your computer and use it in GitHub Desktop.
PS Kill Steam Processes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Steam has an annoying habit of leaving a process hanging when it crashes. | |
This script finds the process ID and kills it. | |
#> | |
# Get the Steam processes | |
$steam_processes = Get-Process | Where {$_.name -like "Steam"} | |
if ($steam_processes -eq $null) { | |
Write-Host "No current Steam processes." | |
} else { | |
ForEach ($proc in $steam_processes) { | |
# Get the process ID associated w/ Steam | |
$current_id = $proc.Id | |
$string_out = "Killing {0}" -f $current_id | |
Write-Host $string_out | |
# Kill Steam process | |
Stop-Process $current_id | |
# Open Task Manager to verify | |
#taskmgr | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment