Getting Detailed Help Information in Powershell

05/27/2009

Windows PowerShell has detailed help documentation for all cmdlets. To display the help topics, use the Get-Help cmdlet. For example, to get help for the Get-Childitem cmdlet, type:

get-help get-childitem

or

get-childitem -?

You can also display one page of each help topic at a time by using the man and help functions. To use them, type man or help followed by the cmdlet name. For example, to display help for the Get-Childitem cmdlet, type

man get-childitem

or

help get-childitem

The Get-Help cmdlet also displays information about conceptual topics in Windows PowerShell. Conceptual help topics begin with the "about_" prefix, such as about_line_editing. (The name of the conceptual topic must be entered in English even on non-English versions of Windows PowerShell.)

To display a list of conceptual topics, type:

get-help about_*

To display a particular help topic, type the topic name, for example:

get-help about_line_editing

Posted in: Software| Tags: Windows Type PowerShell Help Information Childitem man example cmdlet detailed

Getting Summary Command Information

05/27/2009

The Windows PowerShell Get-Command cmdlet retrieves the names of all available commands. When you type Get-Command at a Windows PowerShell prompt, you will see output similar to the following:

PS> Get-Command

CommandType Name Definition

----------- ---- ----------

Cmdlet Add-Content Add-Content [-Path] <String[...

Cmdlet Add-History Add-History [[-InputObject] ...

Cmdlet Add-Member Add-Member [-MemberType] <PS...

...

This output looks a lot like the Help output of Cmd.exe: a tabular summary of internal commands. In the extract of the Get-Command command output shown above, every command shown has a CommandType of Cmdlet. A Cmdlet is Windows PowerShell's intrinsic command type that corresponds roughly to the dir and cd commands of Cmd.exe and to built-ins in UNIX shells such as BASH.

In the output of the Get-Command command, all of the definitions end with ellipses (...) to indicate that PowerShell cannot display all of the content in the available space. When Windows PowerShell displays output, it formats the output as text and then arranges it to make the data fit cleanly into the window. We will talk about this later in the section on formatters.

The Get-Command cmdlet has a Syntax parameter that allows you to retrieve just the syntax of each cmdlet. Enter the Get-Command -Syntax command to display the full output:

PS> Get-Command -Syntax

Add-Content [-Path] <String[]> [-Value] <Object[]> [-PassThru] [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force] [Credential <PSCredential>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm] [-Encoding <FileSystemCmdletProviderEncoding>]

Add-History [[-InputObject] <PSObject[]>] [-Passthru] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>][-OutBuffer <Int32>]...

Posted in: Software| Tags: Windows Type PowerShell Command Information Get summary cmdlet output

Hot Posts

Latest posts

Tags

Others

Sponsors

asp.net interview questions