sharepoint shell 设置列表字段属性

--连接站点

Connect-PnpOnline -url http://dvt193:112

--修改属性

Set-PnPField -List "权限测试" -Identity "权限栏目" -Values @{$ShowInViewForms = $false}

$list=get-pnplist -Identity 权限测试 set-pnpfield -List $list -identity 权限栏目 -Values @{Required="true"}

 

字段显示属性找不到,可以使用shell脚本设置

#Get the web, list and column objects
$web = Get-SPWeb http://dvt193:112
$list = $web.Lists["权限测试"]
$column = $list.Fields["权限栏目"]

#Change the ShowInEditForm property and update objects
$column.ShowInDisplayForm = $false
$column.ShowInNewForm = $false
$column.ShowInEditForm = $false
$column.Update()
$list.Update()
$web.Dispose()




#Get the web, list and column objects
$web = Get-SPWeb http://dvt193:85
$list = $web.Lists["公司列表模板new"]
$column = $list.Fields["发布时间"]
$column1 = $list.Fields["审批时间"]
$column2 = $list.Fields["审批人"]

#Change the ShowInEditForm property and update objects
$column.ShowInDisplayForm = $false
$column.ShowInNewForm = $false
$column.ShowInEditForm = $false
$column1.ShowInDisplayForm = $false
$column1.ShowInNewForm = $false
$column1.ShowInEditForm = $false
$column2.ShowInDisplayForm = $false
$column2.ShowInNewForm = $false
$column2.ShowInEditForm = $false
$column.Update()
$column1.Update()
$column2.Update()
$list.Update()
$web.Dispose()

 

转载于:https://www.cnblogs.com/520yun/p/9052321.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值