Get-Module
Use Get-Module to list modules loaded in the session, or with -ListAvailable those installed and ready to load.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Inspect this authored example with fictional data in the bounded browser model. The numbered stages show how its objects change.
Get-Module | Select-Object Name, Version- Stage 1Get-Module
Positional values or no named parameters - Stage 2Select-Object
Positional values or no named parameters
Try it
Browser simulation · fictional data; no changes to your computer.
Follow the objects
Run the command to inspect each stage.
Examples
Select Name, Version
Show reference output
Illustrative output · values vary by environment
Name Version ------------------------------- ------- Microsoft.PowerShell.Management 7.0.0.0 ActiveDirectory 1.0.1.0 Pester 5.6.1
Select first 5
Show reference output
Illustrative output · values vary by environment
Name Version ------------------------------- ------- Microsoft.PowerShell.Management 7.0.0.0 ActiveDirectory 1.0.1.0 Pester 5.6.1
Expand ExportedCommands
Show reference output
Illustrative output · values vary by environment
Key Value --- ----- Get-ChildItem Get-ChildItem Get-Process Get-Process Get-Service Get-Service
Parameters
Parameter definitions:
-Name-ListAvailable-All-FullyQualifiedName-PSSession
Practical use and troubleshooting
Practical scenario: Use Get-Module when you need to list modules loaded in the session, or with -ListAvailable those installed and ready to load. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: An empty result without -ListAvailable only means no matching module is loaded. Inspect available modules separately and choose the intended version before importing it. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Import-Module. Get-Module inspects loaded modules, or available modules with -ListAvailable; Import-Module loads a module. Finding an installed module does not prove its prerequisites can be loaded. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Put this command to work
Import the testing module
Import Pester, then display the Pester module record.
The sandbox is visible now. Sign in with Google only when you run or check a task; commands and temporary files are discarded when you leave.
Run a command to inspect its result.
Inspect starting data
Supported syntax
Virtual files
Recap
Get-Module Use Get-Module to list modules loaded in the session, or with -ListAvailable those installed and ready to load.
Next: Import-Module