Wednesday, 6 November 2013

create Site Column Using Power shell in sharepoint

Share it Please
$site = Get-SPSite -Identity "http://abcd:1111/sites/Demo1/"
$web = $site.RootWeb
$fieldXML = '<Field Type="Text"
Name="EmpName"
Description="Employee Name Column Info."
DisplayName="EmpName"
Group="Clinic Site Columns"
Hidden="FALSE"
Required="FALSE"
ShowInDisplayForm="TRUE"
ShowInEditForm="TRUE"
ShowInListSettings="TRUE"
ShowInNewForm="TRUE"></Field>'
$web.Fields.AddFieldAsXml($fieldXML)
$web.Dispose()
$site.Dispose()

No comments:

Post a Comment

Followers

Follow The Author