The following script is designed to compare two script directories under the specified themes and determines which ones have different file sizes.
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
# Get tenant theme | |
# Tenant Theme - change this to your desired ID | |
$siteTheme = Get-Item -Path "master:" -ID "{A8665181-7D76-4EEE-B5A3-923FD0671205}" | |
# Basic 2 Theme | |
$basicTheme = Get-Item -Path "master:" -ID "{B43D07BD-61D5-448F-9323-8B6ACAD4F3C4}" | |
# Compare scripts for matching name | |
$siteScripts = $siteTheme.Children["scripts"].Children | Select-Object -Property Name,ID | |
$siteScriptsLookup = $siteScripts | ForEach-Object { $lookup = @{} } { $lookup[$_.Name] = $_.ID } { $lookup } | |
$basicScripts = $basicTheme.Children["scripts"].Children | Select-Object -Property Name,ID | |
$basicScriptsLookup = $basicScripts | ForEach-Object { $lookup = @{} } { $lookup[$_.Name] = $_.ID } { $lookup } | |
# Report when script is different file size | |
$matchingScripts = Compare-Object -ReferenceObject $siteScripts -DifferenceObject $basicScripts -Property Name -IncludeEqual | | |
Where-Object { $_.SideIndicator -eq "==" } | Select-Object -Expand Name | |
foreach($matchingScript in $matchingScripts) { | |
$siteScript = Get-Item -Path "master:" -ID $siteScriptsLookup[$matchingScript] | |
$basicScript = Get-Item -Path "master:" -ID $basicScriptsLookup[$matchingScript] | |
if($siteScript.Size -ne $basicScript.Size) { | |
Write-Host "Version mismatch of $($matchingScript)" | |
} | |
} |
With this information you are hours ahead of where you would have been trying to figure out why the "component-carousel" works on my machine but not in production!
Cheers!
Michael
No comments:
Post a Comment