VERBOSE: Found matching provider: Microsoft-Windows-WindowsUpdateClient
VERBOSE: The Microsoft-Windows-WindowsUpdateClient provider writes events to the System log.
VERBOSE: The Microsoft-Windows-WindowsUpdateClient provider writes events to the Microsoft-Windows-WindowsUpdateClient/Operational log.
VERBOSE: Constructed structured query:
VERBOSE: <QueryList><Query Id="0" Path="system"><Select Path="system">*[System/Provider[@Name='microsoft-windows-windowsupdateclient'] and
VERBOSE: (System/EventID=19)]</Select></Query></QueryList>.
# get all installed modules as a hash table # each key holds all versions of a given module $list = Get-InstalledModule | Get-InstalledModule-AllVersions | Group-Object-Property Name -AsHashTable-AsString
# take all module names... $list.Keys | ForEach-Object { # dump all present versions... $list[$_] | # sort by version descending (newest first) Sort-Object-Property Version -Descending | # and skip newest, returning all other Select-Object-Skip1 } | # remove outdated (check whether you really don't need them anymore) Uninstall-Module-WhatIf