Update Manually Installed PowerShell Modules from the PowerShell Gallery

There are PowerShell modules that ship with Windows 10 that weren’t installed from the PowerShell Gallery using PowerShellGet so they can’t be updated using the Update-Module cmdlet. This also applies for any modules that you’ve installed manually yourself.

The following PowerShell script retrieves a list of the most recent version of the modules in the all users path for PowerShell modules. It determines which ones weren’t installed using PowerShellGet based on the hidden xml file that would exist in the module directory and then it determines if a newer version exists in one of the PowerShell Galleries that’s registered on your computer:


Installing the updated version is as simple as piping the previous results to ForEach-Object and nesting Install-Module with the Force parameter inside of it:


Be sure to read the follow-up to this blog article “PowerShell function to find information about module updates“.



  1. Kayfabe

    Thank you!
    Incredibly helpful! Was trying to self-sign a cert with New-SelfSignedCertificate and it wouldn’t recognize parameters.
    Realized after a while that modules needed to be updated.

  2. Francesco Mantovani

    Thank you for saving 1h of my time


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: