Get a List of All PowerShell Modules

  1. Use Get-Module Cmdlet to Get a List of All PowerShell Modules
  2. Use the Get-Command to Get a List of All Commands in PowerShell

PowerShell module is a package containing PowerShell members, such as cmdlets, providers, functions, workflows, variables, and aliases. PowerShell comes with multiple preinstalled modules, known as the core modules.

This tutorial will teach you to get a list of all available PowerShell modules.

Use Get-Module Cmdlet to Get a List of All PowerShell Modules

The Get-Module cmdlet gets a list of PowerShell modules that can be imported or imported in a PowerShell session. Get-Module lists PowerShell modules imported in the current session without any parameters.

Get-Module

Output:

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.0.0    ISE                                 {Get-IseSnippet, Import-IseSnippet, N...
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoin...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable...

You can use the -ListAvailable parameter to list all installed and available PowerShell modules.

Get-Module -ListAvailable

The environment variable PSModulePath contains the PowerShell modules location path, which you can view using the command below.

$env:PSModulePath -split ';'

Output:

C:\Users\rhntm\OneDrive\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules

Use the Get-Command to Get a List of All Commands in PowerShell

The Get-Command cmdlet lists all commands installed on the computer. It includes cmdlets, aliases, functions, filters, scripts, and applications.

This cmdlet gets the commands from PowerShell modules and commands imported from other sessions.

Without any parameters, Get-Command gets all cmdlets, functions, and aliases installed on the computer.

Get-Command

Output:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           Add-AppPackage                                     2.0.1.0    Appx
Alias           Add-AppPackageVolume                               2.0.1.0    Appx
Alias           Add-AppProvisionedPackage                          3.0        Dism
Alias           Add-ProvisionedAppPackage                          3.0        Dism

You can use the -ListImported parameter to list only commands imported into the current session.

Get-Command -ListImported

You can use the -CommandType or -Type parameter to specify the types of commands that you want to get.

For example, the following example gets only aliases of PowerShell commands.

Get-Command -CommandType Alias

You can specify one or more command types.

We hope this article helped you get a list of all installed, runnable cmdlets and functions in PowerShell.

Write for us
DelftStack articles are written by software geeks like you. If you also would like to contribute to DelftStack by writing paid articles, you can check the write for us page.