PowerTip: Find the Path to a PowerShell Module

Summary: Easily find the path to a Windows PowerShell module.

Hey, Scripting Guy! Question How can I easily find the path to a Windows PowerShell module?

Hey, Scripting Guy! Answer Use the Get-Module cmdlet and a wildcard character for the name, and select the Path property.
          The following script finds the PowerShellISEModule (an optional module in the Script Repository):

(Get-Module -ListAvailable PowerShellIse*).path

You can shorten the command:

(gmo -l PowerShellIse*).path

Comments (4)

  1. someotherjim says:

    I’ve enjoyed your tips ‘foreva’; however, this one is not working for me…

    Get-Module -ListAvailable returns my modules…
    ModuleType Name ExportedCommands
    ———- —- —————-
    Manifest ActiveDirectory {}
    Manifest ADRMS {}
    Manifest ADRMSAdmin {}
    Manifest AppLocker {}

    but even ‘(Get-Module -ListAvailable).path’ – without the PowerShell* filter returns nothing?

  2. alsoszaa says:

    $PSModPath=gmo -l

  3. alsoszaa says:

    or this one-liner:
    ($PSModPath=gmo -l).path

  4. Manuel Hernandez says:

    Get-Module -ListAvailable returns my modules…

Skip to main content