Skip to content

Instantly share code, notes, and snippets.

@tobyqin
Last active December 22, 2015 09:00
Show Gist options
  • Save tobyqin/70c7195fbf38fd9fdb8f to your computer and use it in GitHub Desktop.
Save tobyqin/70c7195fbf38fd9fdb8f to your computer and use it in GitHub Desktop.
function Block-Processes ($pattern)
{
# $pattern=@("Spirit.*")
$proc = Get-Process -Name $pattern
foreach($p in $proc)
{
if($p -ne $null)
{
Stop-Process $p.Id -Force
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment