Skip to content

AndiBellstedt/PackageUpdateInfo

Repository files navigation

logo PackageUpdateInfo - Stay up to date with modules

Plattform Information
PowerShell gallery PowerShell Gallery PowerShell Gallery PowerShell Gallery
GitHub GitHub release GitHub
GitHub issues
GitHub last commit (branch)
GitHub last commit (branch)


Description

The PackageUpdateInfo module helps you staying up to date with you installed modules. It checks all your local installed powershell modules and output a table with module names and version information.

Prerequisites

  • Windows PowerShell 5.1 / PowerShell 6
  • (optional) PowerShell module BurntToast

Installation

Install the module from the PowerShell Gallery (systemwide):

Install-Module PackageUpdateInfo

or install it only for your user:

Install-Module PackageUpdateInfo -Scope CurrentUser

Interactive usage

For interactive usage and check all your modules, just run:

Get-PackageUpdateInfo

This will query all your installed modules and display a overview table which module will need an update and which one is up-to-date.
I would suggest using the switch '-ShowToastNotification' (available with version 1.1.0.0) to get that beautiful notification messages when new versions of modules are detected.

Get-PackageUpdateInfo -ShowToastNotification

Practical usage

Because of -possibly- forgotting to run the command frequently, like once a day or one a week, and of poor performance with a lot of installed moduels, I suggest to automate this one. So it is possible to export and import the Update-Information.

Get-PackageUpdateInfo | Export-PackageUpdateInfo
Import-PackageUpdateInfo -ShowToastNotification

So with this, it is possible to "offload" the update checking to a Job, a scheduled task or the computer startup and show the information quickly with the Import-PackageUpdateInfo command.

I'll suggest to put these lines to you PowerShell profile:

Start-Job -ScriptBlock { Get-PackageUpdateInfo -ShowOnlyNeededUpdate -ShowToastNotification | Export-PackageUpdateInfo } | Out-Null
Import-PackageUpdateInfo

This will start the update checking as a background job and show's you quickly the information from the last job run on every startup of the powershell.

References

The following modules and code snipets inspired me. My goal was to do a short module with rich, powershell styled output and powershell styled functionality.