Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PS Kill Steam Processes
<#
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