Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

PowerTip: Count the Number of Commands Exposed by Imported Modules

$
0
0

Summary: Learn how to count the number of commands exposed by imported Windows PowerShell modules.

Hey, Scripting Guy! Question I want to know how many commands are available through the modules I have imported into my current Windows PowerShell session. How can I do this?

Hey, Scripting Guy! Answer Use the Get-Module cmdlet and pipe the results to the Foreach-Object cmdlet (% is an alias). Inside the script block, use the Get-Command cmdlet to return the commands from each module. Send the results to the Measure-Object (measure is an alias) cmdlet, as shown here.

Get-Module | % {Get-Command -Module $_.name} | measure

 


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>