Bulk Update Field Values Using Sitecore Powershell Extension
$path = "master:/sitecore/content/external_forms" | |
$templateName = "EmailTemplate" | |
$emailAddresses = "test@test.com" | |
$fieldName = "ToEmail" | |
$items = Get-ChildItem -Path $path -Recurse | Where-Object { $_.TemplateName -eq $templateName } | |
foreach($item in $items) { | |
if($item.Fields[$fieldName] -ne 'null'){ | |
$item.Editing.BeginEdit() | |
$item.Fields[$fieldName].Value = $emailAddresses | |
$item.Editing.EndEdit() | |
Write-Host ($item.Name + ": " + $item.Fields[$fieldName].Value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment