Ensure_List_ContentType_WorkflowAssociation_Delete

Language:
PowerShell
Keywords:
SharePoint
Code Snippet

Function Ensure_List_ContentType_WorkflowAssociation_Delete( [Microsoft.SharePoint.SPContentType]$tContentType
                                                           , $wfAssociationName
                                                           ) {
    $tWorkflowAssociation = $tContentType.WorkflowAssociations.GetAssociationByName($wfAssociationName, [System.Globalization.CultureInfo]::CurrentCulture)
    if ($tWorkflowAssociation -ne $null) {
        Write-Output([System.String]::Format("Content Type [{0}] Workflow Association [{1}] : Deleting", $tContentType.Name, $wfAssociationName, $wfEnabled))
        $tContentType.WorkflowAssociations.Remove($tWorkflowAssociation)
    }
} # Function Ensure_List_ContentType_WorkflowAssociation_Delete(...)


Created 2011-10-13
comments powered by Disqus
Login