Skip to content

Instantly share code, notes, and snippets.

@jkavanagh58
Last active May 31, 2018 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkavanagh58/8ff627d07a8d87d50f33b8c54f2f4214 to your computer and use it in GitHub Desktop.
Save jkavanagh58/8ff627d07a8d87d50f33b8c54f2f4214 to your computer and use it in GitHub Desktop.
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