Thursday, January 29, 2015

Powershell script to replace a section of url in a particular field of an item in sharepoint List

try the following command:


Add-PSSnapin Microsoft.SharePoint.PowerShell



#Variables that we are going to use for list editing


$webURL = <a href="http://ift.tt/162wJMV; http://ift.tt/1JRLLmL </a>



#Get the SPWeb object and save it to a variable


$web = Get-SPWeb $webURL



#Get the SPList object to retrieve the "Demo List"


$list = $web.Lists[$listName]



#Get all items in this list and save them to a variable


$items = $list.items


#Go through all items


foreach($item in $items)


{


if($item["UrlColumn"] -eq "http://ift.tt/162wK3d;)


{


#Change the value of the "Title" column


$item["UrlColumn "] = " http://test.com/abc=123 "


#Update the item


$item.Update()


}



}
In case of issues check
http://ift.tt/1JRLLmN





Please Mark it as answer if this reply helps you in resolving the issue,It will help other users facing similar problem


No comments:

Post a Comment