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