Created
January 25, 2023 14:59
-
-
Save bic742/e7c6dc463f27122201fb167c71247d7d to your computer and use it in GitHub Desktop.
This PowerShell script will scan all projects in a given solution for specific assembly and output the project name + assembly version when found. This is intended to be used to locate where a rogue assembly may be coming from in your running environment and get the version aligned with the rest of the system.
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
$searchPath = "C:\my_repo\src" | |
$assemblyName = "Sitecore.Horizon.Integration" | |
$versionPathMap = @{} | |
$files = Get-ChildItem -Path $searchPath -Recurse | | |
Where-Object { $_.Name -eq "$assemblyName.dll" } | |
foreach ($file in $files) { | |
$versionPathMap.Add($file.FullName, [Reflection.AssemblyName]::GetAssemblyName($file.FullName).Version) | |
} | |
foreach ($key in $versionPathMap.Keys) { | |
Write-Host "$key - $($versionPathMap[$key])" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment