PowerShell Genie

Get-InstalledModule

Use Get-InstalledModule to list modules installed by Install-Module, with the version and repository they came from.

Command 1 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — PowerShell module reference

Syntax

1PS> Get-InstalledModule [[-Name] <string[]>] [-RequiredVersion <String>] [-MinimumVersion <String>] [-AllVersions] [-AllowPrerelease] [<CommonParameters>]
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 -ListAvailable | Measure-Object | Select-Object Count
  1. Stage 1Get-Module-ListAvailable
  2. Stage 2Measure-ObjectPositional values or no named parameters
  3. Stage 3Select-ObjectPositional values or no named parameters

    Try it

    Windows PowerShell

    PowerShell example · browser support is limited.

    Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.

    Interactive simulation · fictional data

    Examples

    Select Name, Version, Repository

    1PS> Get-InstalledModule | Select-Object Name, Version, Repository
    Show reference output

    Illustrative output · values vary by environment

    Name                             Version  Repository
    -------------------------------  -------  ----------
    Microsoft.PowerShell.Management  7.0.0.0
    Pester                           5.5.0

    Filter by Count

    1PS> Get-InstalledModule -AllVersions | Group-Object Name | Where-Object Count -gt 1
    Show reference output

    Illustrative output · values vary by environment

    Count  Name
    -----  ----
    2      SampleA
    1      SampleB

    Select Count

    1PS> Get-Module -ListAvailable | Measure-Object | Select-Object Count
    Show reference output

    Illustrative output · values vary by environment

    Count
    -----
    3    

    Parameters

    Parameter definitions:

    • -Name
    • -RequiredVersion
    • -MinimumVersion
    • -AllVersions
    • -AllowPrerelease

    PowerShell module reference on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Get-InstalledModule when you need to list modules installed by Install-Module, with the version and repository they came from. 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: A module imported from a copied folder may not appear here. Check Get-Module -ListAvailable as well and distinguish manual deployment from a PowerShellGet-managed installation. 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: Find-Module. Find-Module searches configured repositories; Get-InstalledModule reports installations tracked by PowerShellGet. The repository catalog and locally discoverable modules are not the same inventory. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Get-InstalledModule reference on Microsoft Learn

    Recap

    Get-InstalledModule Use Get-InstalledModule to list modules installed by Install-Module, with the version and repository they came from.

    Next: Get-Module
    Genie guideGet-InstalledModule

    Use Get-InstalledModule to list modules installed by Install-Module, with the version and repository they came from. The console below is pre-loaded — run it, then change a value and run it again.