Skip to content

Instantly share code, notes, and snippets.

@RyanABailey
Created August 14, 2014 00:31
Show Gist options
  • Save RyanABailey/37db9c2422051114196f to your computer and use it in GitHub Desktop.
Save RyanABailey/37db9c2422051114196f to your computer and use it in GitHub Desktop.
Add field to SharePoint ;ist
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