In PowerShell, modules are the building blocks that extend its functionality. Whether you’re managing Azure, Active Directory, or automating Windows tasks, modules provide reusable commands and scripts that make your job easier.
But before using a module, you often need to check if it’s installed — especially when running scripts across multiple systems or CI/CD pipelines.
In this guide, you’ll learn every method to check if a PowerShell module is installed, how to list all installed modules, and how to troubleshoot missing or conflicting modules.
What Is a PowerShell Module?
A PowerShell module is a package containing cmdlets, functions, variables, and other resources that extend PowerShell’s capabilities.
Modules can be:
- Built-in: Included with Windows (e.g.,
Microsoft.PowerShell.Management) - Custom: Created by you or your organization
- Downloaded: From the PowerShell Gallery using
Install-Module
Method 1: Use Get-Module -ListAvailable
The simplest way to check if a module is installed in PowerShell is by using:
Get-Module -ListAvailableYou can see all the installed modules, like in the screenshot below:

Example: Check for a specific module
Here is an example.
Get-Module -ListAvailable -Name AzIf the module is installed, you’ll see output similar to:
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name
---------- ------- ----
Script 11.3.1 AzIf there’s no output, the module isn’t installed.
Pro Tip:Get-Module without -ListAvailable only shows modules loaded in the current session, not all installed modules.
Check out Get .NET Version Using PowerShell
Method 2: Use Get-InstalledModule (PowerShellGet)
If you installed modules using the PowerShell Gallery, use:
Get-InstalledModuleThis command lists all modules installed via PowerShellGet.
Example: Check for a specific module
Let me show you an example.
Get-InstalledModule -Name PnP.PowerShellIf installed, you’ll see the module name and version. You can see the exact output in the screenshot below:

If not, PowerShell throws an error like:
PackageManagement\Get-Package : No match was found for the specified search criteria and module name 'Az'.Note:
If Get-InstalledModule shows no results, but you know modules exist, it may be due to different module paths between PowerShell 5.1 and PowerShell 7+
Read Pass Variables to a PowerShell Script
Method 3: Check Module Paths with $env:PSModulePath
PowerShell looks for modules in directories defined in the $env:PSModulePath environment variable.
$env:PSModulePath -split ';'You can then manually check whether a module folder exists in those paths.
Example:
Test-Path "C:\Program Files\WindowsPowerShell\Modules\Az"If it returns True, the module is installed in that location.
Method 4: Check Loaded Modules in the Current Session
If you want to see which modules are currently loaded:
Get-ModuleThis is useful when debugging scripts or checking dependencies dynamically.
Check out How to Run PowerShell as Different User?
Method 5: Conditional Check in Scripts
If you’re writing a script and need to verify module existence programmatically, use this pattern:
if (Get-Module -ListAvailable -Name Az) {
Write-Host "Az module is installed."
} else {
Write-Host "Az module is not installed. Installing now..."
Install-Module -Name Az -Force
}This ensures your script can self-heal by installing missing modules automatically.
Method 6: Cross-Version Considerations (PowerShell 5.1 vs 7.x)
PowerShell 5.1 (Windows PowerShell) and PowerShell 7+ (PowerShell Core) may use different module paths.
Modules installed in one version may not appear in the other.
To verify which version you’re using:
$PSVersionTable.PSVersionIf you need to make modules available across both versions, copy them into a shared module directory such as:
C:\Program Files\PowerShell\7\ModulesCheck out Fix “PowerShell Running Scripts is Disabled on This System” Error
Troubleshooting Tips
| Issue | Possible Cause | Solution |
|---|---|---|
Get-InstalledModule shows nothing | Module installed manually or via another user | Use Get-Module -ListAvailable |
| Module found in 5.1 but not in 7.x | Different $env:PSModulePath values | Add shared paths or reinstall |
| Module loads but commands not found | Module not imported correctly | Run Import-Module <ModuleName> |
| Access denied errors | Insufficient permissions | Run PowerShell as Administrator |
In this tutorial, we learned how to check if a module is installed using PowerShell using different methods.
| Command | Purpose |
|---|---|
Get-Module -ListAvailable | List all installed modules |
Get-InstalledModule | List modules installed via PowerShell Gallery |
Get-Module | Show currently loaded modules |
$env:PSModulePath | View module search paths |
Test-Path | Check if a module folder exists |
You may also like:
- Get Your MacBook Pro Model Number Using PowerShell
- Get MacBook Pro Battery Health Using PowerShell
- List Scheduled Tasks with PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.