As you know, Sitecore tends to be unhappy when this happens. A common error message is the following:
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
So, I thought it would be a good exercise to write up a quick PowerShell script that would iterate over items in my tree, and reset the values for a field that I specify.
All you need to do is set the $fieldToReset and $path variable values to suit your needs.
$fieldToReset = "My Field Name";
$path = "master:\sitecore\content\MyItem";
$items = Get-ChildItem -Path $path -Recurse
$items | ForEach-Object { if ($_.fieldToReset -ne $null) {$_.fieldToReset = ""} }
Bless you PowerShell!
0 comments:
Post a Comment