How to modify an item's value in a SharePoint list with PowerShell

后端 未结 2 1181
暖寄归人
暖寄归人 2021-01-20 11:08

How do I use PowerShell to modify an item\'s value in a SharePoint list? When I try the following:

$splist.GetItems() | ForEach-Object{
 #Write-Host $_[\"Ite         


        
2条回答
  •  隐瞒了意图╮
    2021-01-20 11:18

    Here is a summary of what you could try to do:

    $spWeb = Get-SPWeb -Identity http://yourdomain/sites/config
    $spList = $spWeb.Lists["AppSettings"]
    $spItem = $spList.GetItemById(10013) //or another way that you prefer.
    $spItem["Name"] = "MyName"
    $spItem.Update()
    

    For more info you should check out this blog post. It contains examples of how to add, update and delete list items with PowerShell: http://mysharepointwork.blogspot.no/2010/09/addupdatedelete-list-items-using.html

提交回复
热议问题