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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 37. Starting and Using PowerShel... > Discovering Windows PowerShell Comma...

Discovering Windows PowerShell Commands

Few people will 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, as described in the following table.

PowerShell Discovery CommandsComments
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-executionpolicy -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 switches.

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 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 properties and methods you can use with the command. 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 Trial