Skip to content

Instantly share code, notes, and snippets.

@AdamNaj
Created January 5, 2021 12:28
Show Gist options
  • Save AdamNaj/cc4ee54e29629cf460f7638f29797274 to your computer and use it in GitHub Desktop.
Save AdamNaj/cc4ee54e29629cf460f7638f29797274 to your computer and use it in GitHub Desktop.
Get Styles inventory from a given SXA website
$siteroot = "master:\content\Sitecore\MVP"
gci "$($siteroot)\Presentation\Styles" -Recurse |
? { $_.TemplateName -eq "Style" } |
select-object @{Name="EE Category / Horizon Controller Name"; Expression={$_.Parent.DisplayName}},
@{Name="Horizon Controller Type"; Expression={$_.Parent.Fields["Type"]}},
@{Name="Style Name"; Expression={$_.DisplayName}},
@{Name="CSS Class"; Expression={$_.Value}},
@{Name="Allowed on Components"; Expression={($_.PSFields."Allowed Renderings".Items |
% { Get-Item master:\ -ID $_ } |
% { $_.DisplayName }) -join ", " }} |
Show-ListView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment