Created
September 12, 2016 13:33
-
-
Save AlexKasaku/49421cba7cdf964a056243b82b35675f to your computer and use it in GitHub Desktop.
Find Rendering By Parameter And ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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