PowerShell: SharePoint - Cancel All Active Workflows on a List

Updated on 5/13/2013
#PowerShell to terminate active workflows on a list:
 
cls
$site = Get-SPSite http://urltosite
$web = Get-SPWeb http://urltoweb
$list = $web.Lists["workflowtest"]
 
foreach($item in $list.Items)
{
	$activeWfs = $site.WorkflowManager.GetItemActiveWorkflows($item) 
	foreach($activeWf in $activeWfs)
	{
		Write-Host "Active Workflow found:" $activeWf.InstanceId.ToString() "on Item:" $item.Title
		[Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($activeWf)                 
	}
}