Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 26. Understanding PowerShell Com... > Discovering Windows PowerShell Comma...

Discovering Windows PowerShell Commands

Very few people will ever master all of the PowerShell commands. However, you can master a basic self-discovery method used to learn and master any specific command. This method includes three important commands.

PowerShell Discovery CommandDescription
get-command [switches]
PS C:\>get-command
PS C:\>get-command -commandtype
cmdlet
PS C:\>get-command -commandtype
alias
PS C:\>get-command -commandtype
function

The get-command cmdlet shows all of the possible commands. You can list the cmdlets, aliases, or functions separately, as shown by the three examples.
get-help
get-help command [-full |
-detailed | -examples]
PS C:\>get-help set-execution-
policy -full
PS C:\>get-help get-process
-detailed
PS C:\>get-help start-service
-examples

The get-help command provides access to a rich set of built-in help.

You can follow get-help with the name of any command. By default, it provides basic help. However, you can also add the -full, -detailed, or -examples switch.

The -detailed switch expands the basic information with more details and includes examples.

The -full switch provides verbose help, including technical information. It includes all available help information, including examples. It often includes online links for more information.

The -examples switch shows a brief synopsis with the examples.
get-member
command or object | get-member
PS C:\>get-service | get-member

$variable | get-member
PS C:\>$profile | get-member

The get-member command provides information about commands. Almost all of the commands are objects, meaning they have properties and methods.

Properties are descriptions that you can retrieve and sometimes configure.

Methods are actions you can take with the item.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint