Installing Apps and Modules: winget and the PowerShell Gallery

winget finds, installs and updates Windows apps by name, and the PowerShell Gallery does the same for modules, PowerShell's add-on commands, with Find-PSResource and Install-PSResource; because anyone can publish a module, check who made one before you install it.

Apprentice · PowerShell · Updated

After this lesson you can

  • Find, install and update apps with winget search, winget show, winget install and winget upgrade
  • Find and install modules from the PowerShell Gallery with Find-PSResource and Install-PSResource, after checking who published them

Key takeaways

  • winget search finds an app and its Id, winget show says who publishes it, and winget install --id installs it.
  • winget upgrade lists the apps that have a newer version, and winget upgrade --all updates them all.
  • A module is a package of extra commands. Find-PSResource looks one up in the PowerShell Gallery and changes nothing.
  • Install-PSResource installs a module for your account only, so it needs no administrator window.
  • Anyone can publish to the Gallery. Before you install a module, check its author, its project page and how many people use it.

A new laptop needs its apps: an editor, Git, a zip tool, a browser. That usually means ten websites, ten installers, "Next, Next, I agree" ten times, and then each app nagging about its own updates for the rest of the year. Setup day for a new job, or a family PC that needs fixing, goes the same way. PowerShell can do it by name instead, from one window, and the same idea installs extra commands for PowerShell itself.

Apps by name: winget

You met winget when you installed PowerShell 7: Windows' package manager, an app store you type into. Search it by name:

winget search "visual studio code"
Name                                      Id                                      Version Source
--------------------------------------------------------------------------------------------------
Visual Studio Code                        XP9KHM4BK9FZ7Q                          Unknown msstore
Visual Studio Code - Insiders             XP8LFCZM790F6B                          Unknown msstore
Microsoft Visual Studio Code              Microsoft.VisualStudioCode              1.143.1 winget
Microsoft Visual Studio Code CLI          Microsoft.VisualStudioCode.CLI          1.126.0 winget
Microsoft Visual Studio Code Insiders     Microsoft.VisualStudioCode.Insiders     1.127.0 winget
Microsoft Visual Studio Code Insiders CLI Microsoft.VisualStudioCode.Insiders.CLI 1.127.0 winget

The Id column is each app's exact name in the catalog. Look before you install: winget show says who publishes it. Here's the start of its answer:

winget show --id Microsoft.VisualStudioCode
Found Microsoft Visual Studio Code [Microsoft.VisualStudioCode]
Version: 1.143.1
Publisher: Microsoft Corporation
Publisher Url: https://www.microsoft.com/

The publisher is who you expected, so install it by its Id. This changes your computer, so it's shown here rather than run:

winget install --id Microsoft.VisualStudioCode

winget downloads the installer, runs it with no clicks, and ends with Successfully installed. Some apps ask Windows for permission to install for everyone; click Yes only when the app is the one you meant. Your versions will be newer than these.

Keeping apps up to date is one more command. winget upgrade only lists the installed apps that have a newer version waiting; winget upgrade --all installs those updates, one after another.

Modules: extra commands for PowerShell

A module is a package of extra commands for PowerShell, the way an app adds features to a phone. You've installed one already: Pester, the test tool every exercise uses. The PowerShell Gallery (powershellgallery.com) is the public catalog of modules, and Find-PSResource looks one up there without installing anything:

Find-PSResource -Name PSScriptAnalyzer
Name             Version Prerelease Repository Description
----             ------- ---------- ---------- -----------
PSScriptAnalyzer 1.25.0             PSGallery  PSScriptAnalyzer provides script analysis and checks for potential code defects in the scripts by applying a group of built-in or customized rules on the scripts being analyzed.

PSScriptAnalyzer reads your scripts and points out problems, such as a short name like gci where a full name would be clearer. To install it, for your account only, with no administrator window:

Install-PSResource -Name PSScriptAnalyzer

The first time, it asks whether you're sure you want to install from PSGallery, because a new computer doesn't mark the Gallery as trusted yet: type Y and press Enter. It prints nothing when it's done, and its commands work in every new window. Update-PSResource -Name PSScriptAnalyzer gets a newer version later, and Uninstall-PSResource removes one.

Check who published it

Apps in winget's catalog pass checks, a virus scan among them, before they're added. The PowerShell Gallery scans uploads too, but anyone with a free account can publish a module, and a module runs with all your rights, so it can read, change or delete anything you can. Most authors are generous people sharing good tools, and a few aren't. Before you install, look at who made it:

Find-PSResource -Name PSScriptAnalyzer | Select-Object Name, Version, Author, CompanyName, PublishedDate, ProjectUri
Name          : PSScriptAnalyzer
Version       : 1.25.0
Author        : Microsoft Corporation
CompanyName   : Microsoft Corporation
PublishedDate : 3/20/2026 7:25:00 PM
ProjectUri    : https://github.com/PowerShell/PSScriptAnalyzer

Ask four questions: is the author who you expected, is there a project page where you can read the code, was it updated in the last year or two, and do many people use it (the Gallery's page for the module shows its downloads)? Check the spelling too: a name one letter off from a popular module is an old trick.

Windows PowerShell 5.1 has no Install-PSResource; there, Install-Module does the same job. The Gallery commands work the same on a Mac or Linux. winget is Windows only: on a Mac, Homebrew does its job, and on Linux, the system's own package manager.

Check yourself

2 questions to try on the lesson page.

So what

Setting up a computer is a list of names now, not an afternoon of clicking, and a quick look at who published a module keeps that speed safe.

Key terms

Cheat sheets

Related