1
如何使用PowerShell更新列表字段屬性?當我嘗試以下方法:無法使用Sharepoint PowerShell更新列表字段屬性
$site = Get-SPSite -Identity "http://vikas:26112/"
$web= $site.OpenWeb()
$spList = $web.GetList("/Lists/Support Links")
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Text
$spList.Fields.Add("FirstName",$spFieldType,$false)
$spList.Fields[「FirstName」].Description = 「My FirstName Field」
$spList.Fields[「FirstName」].Required=$true
$spList.Fields["FirstName"].EnforceUniqueValues=$true
$spList.update()
$web.Dispose()
執行此FirstName
場之後被添加到列表中,但這一領域的性質保持不變:
Description =""
Required=false
EnforceUniqueValues=false
巨型感謝您的快速反應... 通過我得到這個錯誤,我自己的方式 –
不客氣。如果問題解決了問題,請接受答案。 – jumbo