Last active
January 30, 2025 03:42
-
-
Save markwragg/2f953494d051b12c170f48111a0d878c to your computer and use it in GitHub Desktop.
Check for out of date PowerShell modules
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
$Modules = Get-Module -ListAvailable | | |
Where-Object { $_.RepositorySourceLocation -like '*powershellgallery*'} | | |
Group-Object Name | | |
ForEach-Object { $_.Group | Sort-Object Version -Descending | Select-Object -First 1 } | |
$ModuleCheck = ForEach ($Module in $Modules) { | |
Find-Module -Name $Module | Select-Object Name,Version,@{N='InstalledVersion';E={$Module.Version}} | |
} | |
$OutOfDateModules = $ModuleCheck | Where-Object {[version]$_.Version -gt [version]$_.InstalledVersion} | |
$OutOfDateModules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment