Skip to content

Instantly share code, notes, and snippets.

@AlexKasaku
Created September 12, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexKasaku/49421cba7cdf964a056243b82b35675f to your computer and use it in GitHub Desktop.
Save AlexKasaku/49421cba7cdf964a056243b82b35675f to your computer and use it in GitHub Desktop.
Find Rendering By Parameter And ID
$rendering = Get-Item -Path master:/sitecore/layout/Renderings/Website/Components/Path
foreach ( $item in Get-ChildItem -Path master:/sitecore/content/Home -WithParent )
{
$params = @{ "param" = "*" }
$renderings = Get-Rendering -Item $item -Rendering $rendering -FinalLayout -Parameter $params
if ($renderings.Count -gt 0)
{
# This item has a rendering with the parameter
Write-Host "Found renderings that match on" $item.FullPath
$renderings | % { Write-Host "Complete parameters: " $_.Parameters }
Write-Host "-----------------------"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment