Quantcast
Channel: SharePoint 2013 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 21070

Not able to modify Site Column Properties through powershell

$
0
0

Hi,

I have written below script to create site column,content and add those site columns to content type

Now after this,I am suppose to do site column changes like ‘Required-Yes’,’Allow Multiple Values-Yes’ etc.I am not getting the properties to do so,please help me out in this

$web = get-spweb “http://abc.com”     

$ctypeName = “contenttype1”

$ctypeParent = $web.availablecontenttypes[“Document”]

$ctype = new-object Microsoft.SharePoint.SPContentType($ctypeParent, $web.contenttypes, $ctypeName)

$ctype.Group = “contentgroupname”

$web.contenttypes.add($ctype)

$web.fields.add(“fieldname1”,”fieldtype1”, $false)

$field = $web.fields.getfield(“fieldname1”)

$field.Group = “fieldgroupname”

$fieldLink = new-object Microsoft.SharePoint.SPFieldLink($field)

$ctype.fieldlinks.add($fieldLink)

$ctype.update()

Regards,

Sudheer


Thanks & Regards, Sudheer


Viewing all articles
Browse latest Browse all 21070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>