Ensure_List_DraftItemSecurity

Language:
PowerShell
Keywords:
SharePoint
Code Snippet

Function Ensure_List_DraftItemSecurity( [Microsoft.SharePoint.SPList]$tList
                                      , [Microsoft.SharePoint.DraftVisibilityType]$DraftSecurity
                                      ) {
    if ($DraftSecurity -ne $tList.DraftVersionVisibility) {
        $tList.DraftVersionVisibility = $DraftSecurity
        Write-Output([System.String]::Format("List [{0}] : Setting Draft Item Security [{1}]", $tList.Title, $DraftSecurity))
        $tList.Update()
    }
} # Function Ensure_List_DraftItemSecurity(...)


Created 2011-10-13
comments powered by Disqus
Login