Created
June 15, 2016 23:44
-
-
Save ishu3101/bc9591f42e6abc3b427704663e0bcbd2 to your computer and use it in GitHub Desktop.
Get Reminded of Outdated Modules in Powershell. See https://communary.net/2016/02/21/get-reminded-of-outdated-modules/
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 Get-OutDatedModule(){ | |
| $loadedModules = Get-Module | |
| foreach ($module in $loadedModules) { | |
| $foundModule = Find-Package -Name $module.Name -ErrorAction SilentlyContinue | |
| if ($foundModule) { | |
| if ($module.Version -lt $foundModule.Version) { | |
| Write-Host "$($module.Name): Installed version: $($module.Version.ToString()) - Newest version: " -NoNewline | |
| Write-Host "$($foundModule.Version.ToString())" -ForegroundColor Red | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment