PowerShell for Windows Admins

Sep 19 2011   12:54PM GMT

PowerShell 3 discovery

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Having a quick look at the numbers of commands in PowerShell 3 on Windows 8 I get this

 

PS> (get-command -CommandType cmdlet).count
376
PS> (get-command -CommandType function).count
524

 

The numbers are even higher on Server 8 depending on what  features/roles you have loaded.

 

How do you keep track of all those commands – memorising 900 names is not going to happen never mind the reported 2000+ on the server.

The answer is to step up a level to the module. Remember the modules that are available or use

PS> Get-Module -ListAvailable

    Directory: C:\Scripts\Modules

ModuleType Name                      ExportedCommands
———- —-                      —————-
Manifest   SystemInfo                {Get-ComputerSystem, Get-OperatingSystem}

    Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Name                      ExportedCommands
———- —-                      —————-
Manifest   AppLocker                 {Set-AppLockerPolicy, Get-AppLockerPolicy, Test-AppLockerPolicy…
Manifest   Appx                      {Add-AppxPackage, Get-AppxPackageManifest, Get-AppxPackage…
Manifest   BitLocker                 {Get-EncryptableVolume, Get-EncryptableVolumes, Get-Protectors..
Manifest   BitsTransfer              {Add-BitsFile, Remove-BitsTransfer, Complete-BitsTransfer…
Manifest   BranchCache               {Add-BCDataCacheExtension, Clear-BCCache, Disable-BC…

 

Notice that the folder the module is contained is displayed – useful.

Alternatively refine the search

Get-Module -ListAvailable *dns*

One point to note is that Get-Module by default only shows the modules you’ve used!  A new PowerShell console shows

Microsoft.PowerShell.Core
Microsoft.PowerShell.Management

but

PS> get-module | select name

Name
—-
Microsoft.PowerShell.Core
Microsoft.PowerShell.Management
Microsoft.PowerShell.Utility

because we’ve used select-object

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: