Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
Created October 1, 2024 21:18
Show Gist options
  • Save NathanTheGr8/1f4cc1c012afe118b971115138b37a03 to your computer and use it in GitHub Desktop.
Save NathanTheGr8/1f4cc1c012afe118b971115138b37a03 to your computer and use it in GitHub Desktop.
Get-InstalledModule | ForEach-Object {
$CurrentVersion = $PSItem.Version
Get-InstalledModule -Name $PSItem.Name -AllVersions | Where-Object -Property Version -LT -Value $CurrentVersion
} | Uninstall-Module -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment