Last active
October 21, 2016 11:01
-
-
Save AlexKasaku/e215d62a9ab8ca3f405b8438b119577e to your computer and use it in GitHub Desktop.
Examine renderings in Standard Values to find uses of Shared + Final
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
$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