Skip to content

Instantly share code, notes, and snippets.

@dsolodow
Created March 5, 2018 14:18
Show Gist options
  • Save dsolodow/3cd3b16efa0b68bc80ffd80a1b8b1925 to your computer and use it in GitHub Desktop.
Save dsolodow/3cd3b16efa0b68bc80ffd80a1b8b1925 to your computer and use it in GitHub Desktop.
cleanup installed modules
Get-InstalledModule |
ForEach-Object {
$CurrentVersion = $PSItem.Version
Get-InstalledModule -Name $PSItem.Name -AllVersions |
Where-Object -Property Version -LT $CurrentVersion
} | Uninstall-Module -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment