Created
August 14, 2014 00:31
-
-
Save RyanABailey/37db9c2422051114196f to your computer and use it in GitHub Desktop.
Add field to SharePoint ;ist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin Microsoft.SharePoint.PowerShell | |
[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges( | |
{ | |
$site = SPSite("http://siteurl/") | |
$web = $site.RootWeb | |
$spList = $web.Lists["List Name"] | |
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Boolean | |
$spList.Fields.Add("Field Name",$spFieldType,$false) | |
$spList.Update() | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment