How to find a module for a powershell cmdlet with Get-Command

27 May,2021 by Jack Vamvas

Question: I need to interrogate the module for a Powershell cmdlet but I can't find the actual physical location of the file on the host server.  I can execute the cmd through the Powershell command line OK , but can't find the powershell cmd file. Is there a Powershell method of locating the Powershell module files?

 

Answer:  There is a Powershell method to obtain the physical location of the modules . Check out the Get-Command cmdlet.    There are different usages for this command , and one of the uses is to obtain information about another Powershell cmdlet

For example - if you'd like to find out extra information about the Invoke-SqlVulnerabilityAssessmentScan  cmdlet , you would use : 

Get-Command Invoke-SqlVulnerabilityAssessmentScan | fl *

This command would give you various categories of information - Helpfile, Version, modeule location,Options, Parameters ......


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to find a module for a powershell cmdlet with Get-Command


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer