Trying to add a keyword to the keyword-multilist field with SPE.
$items = Get-ChildItem -Path "master:\sitecore\content\Website\site\subnode" -Recurse
$items | ForEach-Object {
[Sitecore.Data.Fields.MultilistField]$field = $items.Fields["Keywords"]
$items.Editing.BeginEdit()
$field.Add("{6D1EACDD-0DE7-4F3D-B55A-2CAE8EBFF3D0}")
$items.Editing.EndEdit()
}
The idea is to add the same keyword for each item below the subnode, and to every language version. An item can occure in more than one language, and the keywords-section can be empty or have one or more values. SPE returns "You cannot call a method on a null-valued expression." - so I'm kinda stuck...