I want to edit some Placeholder settings with Powershell extensions, which involves adding a specific rendering to some and removing another rendering from others.

Is there a simple syntax based on the field type, or should I just use string replacement to edit the field?

1 Answer 1


You can use all Sitecore types to access and manipulate field value. Example

# get your ph settings item
$phSettings = gi -path '/sitecore/layout/Placeholder Settings/content'

# read field and assign it to MultilistField type
[Sitecore.Data.Fields.MultilistField]$field = $phSettings.Fields["Allowed Controls"]

Now you can read and set values

# read IDs from an array of IDs

# replace ID inside an array

MultilistField is an extension of Sitecore.Data.Fields.DelimitedField field type. Decompile it and see other methods available:

  • public int Count
  • public string[] Items
  • public bool Contains(string item)
  • public string Add(string item)
  • public string Remove(string item)
  • public int IndexOf(string item)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.