Skip to content

Instantly share code, notes, and snippets.

@Madhu-Anbalagan
Last active December 14, 2020 16:34
Show Gist options
  • Save Madhu-Anbalagan/67b5988fcd758e5487a009f02aeca7e1 to your computer and use it in GitHub Desktop.
Save Madhu-Anbalagan/67b5988fcd758e5487a009f02aeca7e1 to your computer and use it in GitHub Desktop.
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