Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function show-installedmodules {
#Requires -Version 5
[CmdletBinding()]
Param(
$varModules = (get-installedmodule)
)
Begin {
"-" * 52
"`tReporting on {0} modules" -f $varModules.Count
"-" * 52
}# End Begin
Process {
$varModules |
sort-object -Property Name |
select-object -Property Name,
Version,
@{
Label = "Online Version";
Expression = {(find-module -Name $_.Name).Version}
} |
format-table -AutoSize
}# End Process
END {
Remove-Variable -Name varModules
[System.GC]::Collect()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.