Examples for managing complex field types such as MultilistField and NameValueListField.
Edit MultilistField
Example: The following demonstrates how to set a field to a known list of Ids. The Id is already converted to a GUID string.
# Hardcoded list of Ids.$item.Editing.BeginEdit()$item["Allowed Controls"]="{guid1}|{guid2}|{guid3}"$item.Editing.EndEdit()
# Array of Ids.$array=[System.Collections.ArrayList]@()$array.Add({guid1})>$null$array.Add({guid2})>$null$ids=[System.String]::Join("|",$array)$item.Editing.BeginEdit()$item["Allowed Controls"]=$ids$item.Editing.EndEdit()
Example: The following replaces an instance of an Id with an alternate Id. The Id is already converted to a GUID string.