Skip to content

Instantly share code, notes, and snippets.

@AlexKasaku
Last active October 21, 2016 11:01
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/e215d62a9ab8ca3f405b8438b119577e to your computer and use it in GitHub Desktop.
Save AlexKasaku/e215d62a9ab8ca3f405b8438b119577e to your computer and use it in GitHub Desktop.
Examine renderings in Standard Values to find uses of Shared + Final
$results = @();
foreach ( $item in Get-ChildItem -Recurse )
{
if ($item.Name -ne "__Standard Values") {
continue;
}
$result = New-Object System.Object
$result | Add-Member -type NoteProperty -name ID -value $item.ID
$result | Add-Member -type NoteProperty -name Path -value $item.FullPath
$result | Add-Member -type NoteProperty -name Shared -value 0
$result | Add-Member -type NoteProperty -name Final -value 0
$result | Add-Member -type NoteProperty -name BothSame -value 0
$result | Add-Member -type NoteProperty -name BothDifferent -value 0
$result | Add-Member -type NoteProperty -name Neither -value 0
if ($item.__Renderings -ne "") {
$result.Shared = 1;
}
if ($item."__Final Renderings" -ne "") {
$result.Final = 1;
}
$result.BothSame = ($result.Shared -band $result.Final) -band ($result.Shared -eq $result.Final)
$result.BothDifferent = ($result.Shared -band $result.Final) -band ($result.Shared -ne $result.Final)
$result.Neither = !$result.Shared -band !$result.Final
$results += $result
}
$results | Show-ListView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment