Last active
May 31, 2018 16:31
-
-
Save jkavanagh58/8ff627d07a8d87d50f33b8c54f2f4214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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