0

I have a column named: 10. London I need to update the value of this column using Powershell. My script works on columns that do not have a full stop (period) in the name "." The internalName does not work. How do I escape the full stop in the column name? I've tried variations e.g. $item["10'.'London'"]

foreach($item in $items){
  %colValue = $item["Title"]
  if (%colValue -eq "SomeText")
  {
    $item["10. London"] = "NewText"
    $item.Update()
    $List.Update()
  }
}
1
  • Couldn't you get a reference to the field by using $list.Fields.GetFieldByInternalName() and then there where you are updating items do $item[$field.ID] = "New Value" or something like that? Commented Mar 21, 2017 at 17:36

1 Answer 1

0

Try URL encoding the period and space like this:

$item[10%2e%20London] = "NewText"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.