PowerShell Get-Module: List Installed and Loaded Modules

PowerShell Get-Module: List Installed and Loaded Modules

PowerShell Tips Editor 4 min read
PowerShell Get-Module: List Installed and Loaded Modules

Before you can debug a “module not found” error or figure out why the wrong version of a function is being called, you need to see exactly what PowerShell has loaded and what it knows about. PowerShell Get-Module is the command that shows you this — listing loaded modules, available modules on disk, their versions, and their paths. This guide covers every practical use of Get-Module so you can diagnose module issues quickly.

List Currently Loaded Modules

Run Get-Module with no arguments to see what’s actually loaded in the current session:

# List all loaded modules
Get-Module

# Get specific columns
Get-Module | Select-Object Name, Version, ModuleType, Path
ModuleType Version    PreRelease Name
---------- -------    ---------- ----
Script     5.4.1                 Pester
Manifest   3.1.0.0               Microsoft.PowerShell.Management
Manifest   3.1.0.0               Microsoft.PowerShell.Utility
Manifest   1.0.0                 MyTools

A module in this list is currently imported and its functions are available. A module that exists on disk but isn’t here hasn’t been imported yet — either call one of its exported functions (auto-import) or run Import-Module explicitly.

List All Installed Modules with -ListAvailable

The -ListAvailable flag scans all paths in $env:PSModulePath and shows every installed module, whether it’s loaded or not:

# All available modules on this machine
Get-Module -ListAvailable

# Filter by name pattern
Get-Module -ListAvailable -Name 'Az*'

# Count installed modules
(Get-Module -ListAvailable).Count
    Directory: C:\Users\Alice\Documents\PowerShell\Modules

ModuleType Version    Name
---------- -------    ----
Script     5.4.1      Pester
Manifest   1.0.0      MyTools

    Directory: C:\Program Files\PowerShell\Modules

ModuleType Version    Name
---------- -------    ----
Manifest   9.3.0      Az
Manifest   2.3.4      PSReadLine

Find Module Version and Path

To see exactly which version of a module is loaded and where it lives on disk:

# Version and path of a specific loaded module
Get-Module -Name Pester | Select-Object Name, Version, Path

# Find all installed versions of a module
Get-Module -ListAvailable -Name Pester | Select-Object Name, Version, Path | Sort-Object Version -Descending
Name   Version Path
----   ------- ----
Pester 5.4.1   C:\Users\Alice\Documents\PowerShell\Modules\Pester\5.4.1\Pester.psd1

Name   Version Path
----   ------- ----
Pester 5.4.1   C:\Users\Alice\Documents\PowerShell\Modules\Pester\5.4.1\Pester.psd1
Pester 5.3.1   C:\Users\Alice\Documents\PowerShell\Modules\Pester\5.3.1\Pester.psd1

If you see multiple versions, the latest typically auto-imports. Import a specific version with Import-Module -Name Pester -RequiredVersion 5.3.1.

Check If a Specific Module Is Available

Use Get-Module with a filter to check for a specific module in a script:

# Check if a module is currently loaded
if (Get-Module -Name 'Pester') {
    Write-Output 'Pester is loaded'
}

# Check if a module is installed (even if not loaded)
if (Get-Module -Name 'ImportExcel' -ListAvailable) {
    Write-Output 'ImportExcel is installed'
    Import-Module ImportExcel
} else {
    Write-Warning 'ImportExcel not installed. Run: Install-Module ImportExcel -Scope CurrentUser'
}
Pester is loaded
WARNING: ImportExcel not installed. Run: Install-Module ImportExcel -Scope CurrentUser

Removing a Module with Remove-Module

To unload a module from the current session (without uninstalling it from disk):

# Unload a module — functions from it will no longer be available
Remove-Module -Name Pester

# Verify it's gone
Get-Module -Name Pester

# Force remove if it resists
Remove-Module -Name Pester -Force

This is useful when testing module updates — unload the old version, then Import-Module to load the updated file without restarting PowerShell.

Find-Module from PSGallery

To discover modules in the online PowerShell Gallery (not yet installed):

# Search for modules
Find-Module -Name '*excel*'

# See module details
Find-Module -Name 'ImportExcel' | Select-Object Name, Version, Author, Description

# Find all modules published by a specific author
Find-Module -Tag 'ActiveDirectory'
Version Name         Repository Description
------- ----         ---------- -----------
7.8.9   ImportExcel  PSGallery  PowerShell Import and Export to Excel without

Common Errors and Fixes

  • Module installed but not in PSModulePath: If Get-Module -ListAvailable doesn’t show a module you know is installed, its directory isn’t in $env:PSModulePath. Check where you installed it and ensure that path appears in the module search path. Run $env:PSModulePath -split ';' to see all current paths.
  • Old version loaded despite newer version installed: PowerShell caches module imports for the session. If you updated a module and the old version is still in memory, run Remove-Module -Name modulename -Force and then Import-Module -Name modulename to reload the latest version.

Related Cmdlets / See Also

Wrapping Up

Get-Module without arguments shows what’s loaded now; with -ListAvailable it shows everything installed. Use it to diagnose version conflicts, verify installations, and build conditional import logic in your scripts. Pair it with Remove-Module to reload updated modules without restarting your session. Your next step: run Get-Module -ListAvailable | Sort-Object Name and audit what’s installed on your system.

Send-Item -To