Skip to content

Instantly share code, notes, and snippets.

@ericdorsey
Created August 20, 2016 23:40
Show Gist options
  • Save ericdorsey/60e99db42ade0fa13c03f83ee11ceb19 to your computer and use it in GitHub Desktop.
Save ericdorsey/60e99db42ade0fa13c03f83ee11ceb19 to your computer and use it in GitHub Desktop.
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