Created
December 22, 2024 22:31
-
-
Save royvou/d0a1bddcaa1ba06aec413b2a2573a71f to your computer and use it in GitHub Desktop.
This file contains hidden or 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-InstalledModule | ForEach-Object { | |
Write-Verbose "Uninstalling old versions of $($_.Name) [latest is $($_.Version)]" -Verbose | |
Get-InstalledModule -Name $_.Name -AllVersions | Where-Object { $_.Version -ne $_.Version } | Uninstall-Module -Verbose | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment