Photo by Jungwoo Hong / Unsplash
Update all PowerShell modules at once

Update all PowerShell modules at once

Published on 28 Jul 2020

Bastien Perez
Bastien Perez

Clap

If you download modules from PowerShell Gallery, you often need to update the module with Update-Module to be up-to-date.

I don’t like to update one by one, and even if I do in bulk with Get-InstalledModule | Update-Module I miss information about:

  • the current module version
  • to which version the module will be updated and the publication date of this version
  • the old module versions: you can have several versions of a same PowerShell module on your computer. But when you run Update-Module, only the newest version is updated, so you keep old versions on your computer

To fix this, I made a PowerShell script to update all the PowerShell modules at once. This script provide informations about the module version (current and the latest available on PowerShell Gallery) and update all the modules. If you have a module with two or more versions, the script delete them and reinstall only the latest.

You can find the last version of this script on my Github:

GitHub - itpro-tips/PowerShell-Toolbox
Contribute to itpro-tips/PowerShell-Toolbox development by creating an account on GitHub.

Comments

banner-Bastien Perez
Bastien Perez

Freelance Microsoft 365 - Active Directory - Modern Workplace

France