Skip to main content

Posts

Showing posts with the label SingleLineOfText

Update List Items : Replace a value in a field which contains some text(URL in this case)

Consider a scenario wherein you need to replace a part of value in single line of text. 1) Fetch List Items based on a particular condition using CAML Query Eg: Get all list items where status = "In Progress" and Content Type ="My Content" 2) From the list items returned by CAML query, modify and replace a particular string from a value. 3) Column type is single line of text Add-PSSnapin Microsoft.Sharepoint.Powershell cls #Log Variables $LogFolderPath = "C:\Logs\"  # LogFolderPath # Text File Path $LogFilePath = $LogFolderPath+ "txtLog_WF_UPDATE_"+(Get-Date).ToString("MM_dd_yyyy_hh_mm_ss")+".txt" # CSV Log File Path with current time stamp $CSVLogFilePath=$LogFolderPath+ "CsvLog_WF_UPDATE_"+(Get-Date).ToString("MM_dd_yyyy_hh_mm_ss")+".csv" #SP variables $web=$null ; $list=$null; $SiteURL = "http://mysharepointsite:30042/sites/en-us"# Library Site Url $ListName =