Add-PSSnapin microsoft.sharepoint.powershell
# URL of the Site
$web = Get-SPWeb -Identity "http://somesharepointsite.com/sites/collection/subweb"
#Get workflow manager
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["Some SharePoint List"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("Some Workflow","en-US")
$count = 0
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
#Pause one minute between each workflow
Start-Sleep -s 60
#Fire the workflow for that item
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
#Write to console that the workflow has fired
write-host "Workflow fired for item: " $item.Name
}
$manager.Dispose()
$web.Dispose()
# URL of the Site
$web = Get-SPWeb -Identity "http://somesharepointsite.com/sites/collection/subweb"
#Get workflow manager
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["Some SharePoint List"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("Some Workflow","en-US")
$count = 0
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
#Pause one minute between each workflow
Start-Sleep -s 60
#Fire the workflow for that item
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
#Write to console that the workflow has fired
write-host "Workflow fired for item: " $item.Name
}
$manager.Dispose()
$web.Dispose()