Try this code, I have modified the custom rendering parameter like the "Ajax Options"Ajax Options
check box.
Also Write a log on every step:-
$languages = @('en')
$startPath = '/sitecore/content/xxx/xxx/Presentation/Partial Designs/Frenchs/Recipe'
$renderingNames = @('Menu Wrapper')
$renderingParamterToUpdate = "Ajax Call"
$newRenderingParameterValue = "0"
foreach($language in $languages){
$items = Get-ChildItem -Path $startPath -Language $language -Recurse
foreach($item in $items){
Write-Host 'Updating Item: ' $item.Paths.FullPath
foreach($itemRendering in Get-Rendering -Item $item -FinalLayout) {
$renderingItem = Get-Item -Path master: -ID $itemRendering.ItemID
if($renderingNames -contains $renderingItem.Name){
Write-Host 'Found Rendering: ' $($renderingItem.Name)
$parameters = Get-RenderingParameter -Rendering $itemRendering
if($parameters[$renderingParamterToUpdate] -ne $newRenderingParameterValue){
Write-Host 'Updating' $renderingParamterToUpdate -ForegroundColor Green
$parameters[$renderingParamterToUpdate] = $newRenderingParameterValue
$itemRendering | Set-RenderingParameter -Parameter $parameters |
Set-Rendering -Item $item -FinalLayout
}
}
}
}
}
$languages = @('en')
$startPath = '/sitecore/content/xxx/xxx/Presentation/Partial Designs/Frenchs/Recipe'
$renderingNames = @('Menu Wrapper')
$renderingParamterToUpdate = "Ajax Call"
$newRenderingParameterValue = "0"
foreach($language in $languages){
$items = Get-ChildItem -Path $startPath -Language $language -Recurse
foreach($item in $items){
Write-Host 'Updating Item: ' $item.Paths.FullPath
foreach($itemRendering in Get-Rendering -Item $item -FinalLayout) {
$renderingItem = Get-Item -Path master: -ID $itemRendering.ItemID
if($renderingNames -contains $renderingItem.Name){
Write-Host 'Found Rendering: ' $($renderingItem.Name)
$parameters = Get-RenderingParameter -Rendering $itemRendering
if($parameters[$renderingParamterToUpdate] -ne $newRenderingParameterValue){
Write-Host 'Updating' $renderingParamterToUpdate -ForegroundColor Green
$parameters[$renderingParamterToUpdate] = $newRenderingParameterValue
$itemRendering | Set-RenderingParameter -Parameter $parameters |
Set-Rendering -Item $item -FinalLayout
}
}
}
}
}