简体   繁体   English

使用 powershell 更新 Sharepoint 所有列表项

[英]Update Sharepoint All list items using powershell

I have a list with 10,000 which uses a Nintex form.我有一个使用 Nintex 表单的 10,000 个列表。 I have added a calculated column(Connected to a list column) on the form which gets the value based on other sql request field on the form.我在表单上添加了一个计算列(连接到列表列),它根据表单上的其他 sql 请求字段获取值。 All new items will be having the calculated column value.所有新项目都将具有计算的列值。 Is there a way I can update all the list items with the value from the form.有没有办法可以使用表单中的值更新所有列表项。 I know you can update the list items using powershell, but you need to have value to update it with.我知道您可以使用 powershell 更新列表项,但您需要具有更新它的价值。 If you open the existing form and save it without doing anything it takes effect, but I cannot open 10,000 items for it to take effect.如果您打开现有表单并保存它而不做任何事情,它会生效,但我无法打开 10,000 项使其生效。 Is there any easy way to do this?有什么简单的方法可以做到这一点?

You oucld use powershell to update the list items, you don't need to have value to update it with.您可以使用 powershell 来更新列表项,您不需要具有更新它的价值。

Below code for your reference:以下代码供您参考:

$web=get-spweb http://yoursite
$list=$web.lists['ListName']
$items=$list.items
foreach($item in $items){
$item.update()
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM