diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md b/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md index 8cc6b01cfac6..6920d2a4258a 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md @@ -10,46 +10,55 @@ title: Get-Help # Get-Help ## SYNOPSIS + Displays information about Windows PowerShell commands and concepts. + ## SYNTAX ### AllUsersView (Default) + ``` Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Full] [] ``` ### DetailedView + ``` Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Detailed] [] ``` ### Examples + ``` Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Examples] [] ``` ### Parameters + ``` Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] -Parameter [] ``` ### Online -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Online] [] ``` ### ShowWindow + ``` Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-ShowWindow] [] ``` ## DESCRIPTION + The **Get-Help** cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, functions, CIM commands, workflows, providers, aliases and scripts. To get help for a Windows PowerShell command, type "Get-Help" followed by the command name, such as: `Get-Help Get-Process`. @@ -73,7 +82,7 @@ To download or update the help files for a module in Windows PowerShell 3.0, use You can also view the help topics for Windows PowerShell online in the TechNet Library. To get the online version of a help topic, use the **Online** parameter, such as: `Get-Help Get-Process -Online`. -You can read all of the help topics beginning at: http://go.microsoft.com/fwlink/?LinkID=107116http://go.microsoft.com/fwlink/?LinkID=107116. +You can read all of the help topics beginning at: http://go.microsoft.com/fwlink/?LinkID=107116. If you type "Get-Help" followed by the exact name of a help topic, or by a word unique to a help topic, **Get-Help** displays the topic contents. If you enter a word or word pattern that appears in several help topic titles, **Get-Help** displays a list of the matching titles. @@ -83,28 +92,34 @@ If you enter a word that does not appear in any help topic titles, **Get-Help** **Get-Help** first looks for help files in the locale set for Windows, then in the parent locale (such as "pt" for "pt-BR"), and then in a fallback locale. Beginning in Windows PowerShell 3.0, if **Get-Help** does not find help in the fallback locale, it looks for help topics in English ("en-US") before returning an error message or displaying auto-generated help. -For information about the symbols that **Get-Help** displays in the command syntax diagram, see about_Command_Syntaxhttp://go.microsoft.com/fwlink/?LinkID=113215. -For information about parameter attributes, such as **Required** and **Position**, see about_Parametershttp://go.microsoft.com/fwlink/?LinkID=113243. +For information about the symbols that **Get-Help** displays in the command syntax diagram, see [about_Command_Syntax](about/about_Command_Syntax.md). +For information about parameter attributes, such as **Required** and **Position**, see [about_Parameters](about/about_parameters.md). **TROUBLESHOOTING NOTE**: In Windows PowerShell 3.0, **Get-Help** cannot find About topics in modules unless the module is imported into the current session. This is a known issue. To get About topics in a module, import the module, either by using the Import-Module cmdlet or by using a cmdlet in the module. + ## EXAMPLES ### Example 1 -``` + +```powershell PS C:\> Get-Help ``` This command displays help about the Windows PowerShell help system. + ### Example 2 -``` + +```powershell PS C:\> Get-Help * ``` This command displays a list of the available help topics. + ### Example 3 -``` + +```powershell PS C:\> Get-Help Get-Alias PS C:\> Help Get-Alias PS C:\> Get-Alias -? @@ -113,51 +128,60 @@ PS C:\> Get-Alias -? These commands display basic information about the Get-Alias cmdlet. The "Get-Help" and "-?" commands display the information on a single page. The "Help" command displays the information one page at a time. + ### Example 4 -``` + +```powershell PS C:\> Get-Help about_* ``` This command displays a list of the conceptual topics included in Windows PowerShell help. All of these topics begin with the characters "about_". -To display a particular help file, type "get-help \, for example, "Get-Help about_Signing". +To display a particular help file, type "Get-Help \, for example, "Get-Help about_Signing". This command displays the conceptual topics only when the help files for those topics are installed on the computer. For information about downloading and installing help files in Windows PowerShell 3.0, see Update-Help. + ### Example 5 -``` + The first command uses the **Get-Help** cmdlet to get help for the Get-Command cmdlet. Without help files, **Get-Help** display the cmdlet name, syntax and alias of **Get-Command**, and prompts you to use the Update-Help cmdlet to get the newest help files. + +```powershell PS C:\> Get-Help Get-Command +``` + +```Output NAME Get-Command - SYNTAX Get-Command [[-Name] ] [-CommandType {Alias | Function | Filter | Cmdlet | ExternalScript | Application | Script | All}] [[-ArgumentList] ] [-Module ] [-Syntax] [-TotalCount ] [] - Get-Command [-Noun ] [-Verb ] [[-ArgumentList] ] [-Module ] [-Syntax] [-TotalCount ] [] - - ALIASES gcm - REMARKS Get-Help cannot find the help files for this cmdlet on this computer. It is displaying only partial help. To download and install help files for this cmdlet, use Update-Help. +``` The second command runs the Update-Help cmdlet without parameters. This command downloads help files from the Internet for all of the modules in the current session and installs them on the local computer.This command works only when the local computer is connected to the Internet. If your computer is not connected to the Internet, you might be able to install help files from a network share. For more information, see Save-Help. + +```powershell PS C:\> Update-Help +``` Now that the help files are downloaded, we can repeat the first command in the sequence. This command gets help for the **Get-Command** cmdlet. The cmdlet now gets more extensive help for **Get-Command** and you can use the **Detailed**, **Full**, **Example**, and **Parameter** parameters of **Get-Help** to customize the displays.You can use the **Get-Help** cmdlet as soon as the Update-Help command completes. You do not need to restart Windows PowerShell. + +```powershell PS C:\> Get-Help Get-Command ``` @@ -169,9 +193,11 @@ You can use the same command sequence to update the help files on your computer To download and install the help files for the commands that come with Windows PowerShell, and for any modules in the $pshome\Modules directory, open Windows PowerShell with the "Run as administrator" option. If you are not a member of the Administrators group on the computer, you cannot download help for these modules. -However, you can use the **Online** parameter to open the online version of help for a command, and you can read the help for Windows PowerShell in the TechNet Library beginning at http://go.microsoft.com/fwlink/?LinkID=107116http://go.microsoft.com/fwlink/?LinkID=107116. +However, you can use the **Online** parameter to open the online version of help for a command, and you can read the help for Windows PowerShell at https://docs.microsoft.com/powershell/scripting. + ### Example 6 -``` + +```powershell PS C:\> Get-Help ls -Detailed ``` @@ -179,8 +205,10 @@ This command displays detailed help for the Get-ChildItem cmdlet by specifying o To see the complete help topic for a cmdlet, use the **Full** parameter. The **Full** and **Detailed** parameters are effective only when help files for the command are installed on the computer. + ### Example 7 -``` + +```powershell PS C:\> Get-Help Format-Table -Full ``` @@ -188,8 +216,10 @@ This command uses the **Full** parameter of **Get-Help** to display the full vie The full view of help includes parameter descriptions, examples, and a table of technical details about the parameters. The **Full** parameter is effective only when help files for the command are installed on the computer. + ### Example 8 -``` + +```powershell PS C:\> Get-Help Start-Service -Examples ``` @@ -197,15 +227,19 @@ This command displays examples of using the Start-Service cmdlet. It uses the **Examples** parameter of **Get-Help** to display only the Examples section of the cmdlet help topics. The **Examples** parameter is effective only when help files for the command are installed on the computer. + ### Example 9 -``` + +```powershell PS C:\> Get-Help Format-List -Parameter GroupBy ``` This command uses the **Parameter** parameter of **Get-Help** to display a detailed description of the **GroupBy** parameter of the Format-List cmdlet. For detailed descriptions of all parameters of the **Format-List** cmdlet, type "`Get-Help Format-List -Parameter *`". + ### Example 10 -``` + +```powershell PS C:\> Get-Help Add-Member -Full | Out-String -Stream | Select-String -Pattern Clixml ``` @@ -213,30 +247,38 @@ This example shows how to search for a word in particular cmdlet help topic. This command searches for the word "Clixml" in the full version of the help topic for the Add-Member cmdlet. Because the **Get-Help** cmdlet generates a **MamlCommandHelpInfo** object, not a string, you need to use a cmdlet that transforms the help topic content into a string, such as Out-String or Out-File. + ### Example 11 -``` + +```powershell PS C:\> Get-Help Get-Member -Online ``` This command displays the online version of the help topic for the Get-Member cmdlet. + ### Example 12 -``` + +```powershell PS C:\> Get-Help remoting ``` This command displays a list of topics that include the word "remoting." When you enter a word that does not appear in any topic title, **Get-Help** displays a list of topics that include that word. + ### Example 13 -``` + The first command uses the **Path** parameter of **Get-Help** to specify the provider path. This command can be entered at any path location. + +```powershell PS C:\> Get-Help Get-Item -Path SQLSERVER:\DataCollection +``` +```Output NAME Get-Item - SYNOPSIS Gets a collection of Server objects for the local computer and any computers @@ -244,16 +286,20 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... +``` The second command uses the Set-Location cmdlet (alias = "cd") to navigate to the provider path. From that location, even without the **Path** parameter, the **Get-Help** command gets the provider-specific help for the **Get-Item** cmdlet. + +```powershell PS C:\> cd SQLSERVER:\DataCollection SQLSERVER:\DataCollection> Get-Help Get-Item +``` +```Output NAME Get-Item - SYNOPSIS Gets a collection of Server objects for the local computer and any computers @@ -261,16 +307,19 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... - +``` The third command shows that a **Get-Help** command in a file system path, and without the **Path** parameter, gets the standard help for the **Get-Item** cmdlet. + +```powershell PS C:\> Get-Item +``` +```Output NAME Get-Item - SYNOPSIS Gets the item at the specified location. @@ -281,14 +330,17 @@ This example shows how to get help that explains how to use the Get-Item cmdlet The example shows two ways of getting the provider-specific help for **Get-Item**. You can also get provider-specific help for cmdlets online in the section that describes the provider. -For example, for provider-specific online help for the New-Item cmdlet in each WSMan provider path, see http://go.microsoft.com/fwlink/?LinkID=158676http://go.microsoft.com/fwlink/?LinkID=158676. +For example, for provider-specific online help for the New-Item cmdlet in each WSMan provider path, see http://go.microsoft.com/fwlink/?LinkID=158676. + ### Example 14 -``` + +```powershell PS C:\> Get-Help C:\PS-Test\MyScript.ps1 ``` This command gets help for the MyScript.ps1 script. -For information about writing help for your functions and scripts, see about_Comment_Based_Helphttp://go.microsoft.com/fwlink/?LinkID=144309. +For information about writing help for your functions and scripts, see [about_Comment_Based_Help](about/about_Comment_Based_Help.md). + ## PARAMETERS ### -Category @@ -532,18 +584,23 @@ Accept wildcard characters: False ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### None You cannot pipe objects to this cmdlet. + ## OUTPUTS ### ExtendedCmdletHelpInfo If you run **Get-Help** on a command that does not have a help file, **Get-Help** returns an ExtendedCmdletHelpInfo object that represents autogenerated help. + ### System.String If you get a conceptual help topic, **Get-Help** returns it as a string. + ### MamlCommandHelpInfo If you get a command that has a help file, **Get-Help** returns a **MamlCommandHelpInfo** object. + ## NOTES * Without parameters, "Get-Help" displays information about the Windows PowerShell help system. * Windows PowerShell 3.0 does not come with help files. To download and install the help files that **Get-Help** reads, use the Update-Help cmdlet. You can use the **Update-Help** cmdlet to download and install help files for the core commands that come with Windows PowerShell and for any modules that you install. You can also use it to update the help files so that the help on your computer is never outdated. @@ -552,24 +609,19 @@ If you get a command that has a help file, **Get-Help** returns a **MamlCommandH * **Get-Help** displays help in the locale set for Windows or in the fallback language for that locale. If you do not have help files for the primary or fallback locale, **Get-Help** behaves as though there are no help files on the computer. To get help for a different locale, use Region and Language in Control Panel to change the settings for Windows. * The full view of help (-Full) includes a table of information about the parameters. The table includes the following fields: - - Required: Indicates whether the parameter is required (true) or optional (false). - - Position: Indicates whether the parameter is named or positional (numbered). -Positional parameters must appear in a specified place in the command. - + Positional parameters must appear in a specified place in the command. - "Named" indicates that the parameter name is required, but that the parameter can appear anywhere in the command. - - - \ indicates that the parameter name is optional, but when the name is omitted, the parameter must be in the place specified by the number. -For example, "2" indicates that when the parameter name is omitted, the parameter must be the second (2) or only unnamed parameter in the command. -When the parameter name is used, the parameter can appear anywhere in the command. - + - \ indicates that the parameter name is optional, but when the name is omitted, the parameter must be in the + place specified by the number. + For example, "2" indicates that when the parameter name is omitted, the parameter must be the second (2) or only unnamed + parameter in the command. When the parameter name is used, the parameter can appear anywhere in the command. - Default value: The parameter value that Windows PowerShell uses if you do not include the parameter in the command. - - Accepts pipeline input: Indicates whether you can (true) or cannot (false) send objects to the parameter through a pipeline. -"By Property Name" means that the pipelined object must have a property with the same name as the parameter name. - + "By Property Name" means that the pipelined object must have a property with the same name as the parameter name. - Accepts wildcard characters: Indicates whether the value of a parameter can include wildcard characters, such as * and ?. + ## RELATED LINKS [Updatable Help Status Table (http://go.microsoft.com/fwlink/?LinkID=270007)](http://go.microsoft.com/fwlink/?LinkID=270007) @@ -580,7 +632,7 @@ When the parameter name is used, the parameter can appear anywhere in the comman [Get-Member](../Microsoft.PowerShell.Utility/Get-Member.md) -[Get-PSDrive](../microsoft.powershell.management/get-psdrive.md) +[Get-PSDrive](../microsoft.powershell.management/Get-PSDrive.md) [about_Comment_Based_Help](About/about_Comment_Based_Help.md) diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md b/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md index 48e6773649a4..d6c913787ef5 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md @@ -11,47 +11,55 @@ title: Get-Help # Get-Help ## SYNOPSIS + Displays information about Windows PowerShell commands and concepts. ## SYNTAX ### AllUsersView (Default) -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Full] [] ``` ### DetailedView -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Detailed] [] ``` ### Examples -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Examples] [] ``` ### Parameters -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] -Parameter [] ``` ### Online -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Online] [] ``` ### ShowWindow -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-ShowWindow] [] ``` ## DESCRIPTION + The **Get-Help** cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, functions, CIM commands, workflows, providers, aliases and scripts. To get help for a Windows PowerShell command, type "Get-Help" followed by the command name, such as: `Get-Help Get-Process`. @@ -95,21 +103,24 @@ To get About topics in a module, import the module, either by using the Import-M ## EXAMPLES ### Example 1 -``` + +```powershell PS C:\> Get-Help ``` This command displays help about the Windows PowerShell help system. ### Example 2 -``` + +```powershell PS C:\> Get-Help * ``` This command displays a list of the available help topics. ### Example 3 -``` + +```powershell PS C:\> Get-Help Get-Alias PS C:\> Help Get-Alias PS C:\> Get-Alias -? @@ -120,25 +131,29 @@ The "Get-Help" and "-?" commands display the information on a single page. The "Help" command displays the information one page at a time. ### Example 4 -``` + +```powershell PS C:\> Get-Help about_* ``` This command displays a list of the conceptual topics included in Windows PowerShell help. All of these topics begin with the characters "about_". -To display a particular help file, type "get-help \, for example, "Get-Help about_Signing". +To display a particular help file, type "Get-Help \, for example, "Get-Help about_Signing". This command displays the conceptual topics only when the help files for those topics are installed on the computer. For information about downloading and installing help files in Windows PowerShell 3.0, see Update-Help. ### Example 5 -``` + The first command uses the **Get-Help** cmdlet to get help for the Get-Command cmdlet. Without help files, **Get-Help** display the cmdlet name, syntax and alias of **Get-Command**, and prompts you to use the Update-Help cmdlet to get the newest help files. +```powershell PS C:\> Get-Help Get-Command +``` + +```Output NAME Get-Command - SYNTAX Get-Command [[-Name] ] [-CommandType {Alias | Function | Filter | Cmdlet | ExternalScript | Application | @@ -151,20 +166,22 @@ SYNTAX [-TotalCount ] [] - ALIASES gcm - REMARKS Get-Help cannot find the help files for this cmdlet on this computer. It is displaying only partial help. To download and install help files for this cmdlet, use Update-Help. +``` The second command runs the Update-Help cmdlet without parameters. This command downloads help files from the Internet for all of the modules in the current session and installs them on the local computer.This command works only when the local computer is connected to the Internet. If your computer is not connected to the Internet, you might be able to install help files from a network share. For more information, see Save-Help. +```powershell PS C:\> Update-Help +``` Now that the help files are downloaded, we can repeat the first command in the sequence. This command gets help for the **Get-Command** cmdlet. The cmdlet now gets more extensive help for **Get-Command** and you can use the **Detailed**, **Full**, **Example**, and **Parameter** parameters of **Get-Help** to customize the displays.You can use the **Get-Help** cmdlet as soon as the Update-Help command completes. You do not need to restart Windows PowerShell. +```powershell PS C:\> Get-Help Get-Command ``` @@ -179,7 +196,8 @@ If you are not a member of the Administrators group on the computer, you cannot However, you can use the **Online** parameter to open the online version of help for a command, and you can read the help for Windows PowerShell in the TechNet Library beginning at http://go.microsoft.com/fwlink/?LinkID=107116http://go.microsoft.com/fwlink/?LinkID=107116. ### Example 6 -``` + +```powershell PS C:\> Get-Help ls -Detailed ``` @@ -189,7 +207,8 @@ To see the complete help topic for a cmdlet, use the **Full** parameter. The **Full** and **Detailed** parameters are effective only when help files for the command are installed on the computer. ### Example 7 -``` + +```powershell PS C:\> Get-Help Format-Table -Full ``` @@ -199,7 +218,8 @@ The full view of help includes parameter descriptions, examples, and a table of The **Full** parameter is effective only when help files for the command are installed on the computer. ### Example 8 -``` + +```powershell PS C:\> Get-Help Start-Service -Examples ``` @@ -209,7 +229,8 @@ It uses the **Examples** parameter of **Get-Help** to display only the Examples The **Examples** parameter is effective only when help files for the command are installed on the computer. ### Example 9 -``` + +```powershell PS C:\> Get-Help Format-List -Parameter GroupBy ``` @@ -217,7 +238,8 @@ This command uses the **Parameter** parameter of **Get-Help** to display a deta For detailed descriptions of all parameters of the **Format-List** cmdlet, type "`Get-Help Format-List -Parameter *`". ### Example 10 -``` + +```powershell PS C:\> Get-Help Add-Member -Full | Out-String -Stream | Select-String -Pattern Clixml ``` @@ -227,14 +249,16 @@ This command searches for the word "Clixml" in the full version of the help topi Because the **Get-Help** cmdlet generates a **MamlCommandHelpInfo** object, not a string, you need to use a cmdlet that transforms the help topic content into a string, such as Out-String or Out-File. ### Example 11 -``` + +```powershell PS C:\> Get-Help Get-Member -Online ``` This command displays the online version of the help topic for the Get-Member cmdlet. ### Example 12 -``` + +```powershell PS C:\> Get-Help remoting ``` @@ -243,32 +267,36 @@ This command displays a list of topics that include the word "remoting." When you enter a word that does not appear in any topic title, **Get-Help** displays a list of topics that include that word. ### Example 13 -``` + The first command uses the **Path** parameter of **Get-Help** to specify the provider path. This command can be entered at any path location. +```powershell PS C:\> Get-Help Get-Item -Path SQLSERVER:\DataCollection +``` +```Output NAME Get-Item - SYNOPSIS Gets a collection of Server objects for the local computer and any computers to which you have made a SQL Server PowerShell connection. - ... +``` The second command uses the Set-Location cmdlet (alias = "cd") to navigate to the provider path. From that location, even without the **Path** parameter, the **Get-Help** command gets the provider-specific help for the **Get-Item** cmdlet. +```powershell PS C:\> cd SQLSERVER:\DataCollection SQLSERVER:\DataCollection> Get-Help Get-Item +``` +```Output NAME Get-Item - SYNOPSIS Gets a collection of Server objects for the local computer and any computers @@ -276,11 +304,14 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... - +``` The third command shows that a **Get-Help** command in a file system path, and without the **Path** parameter, gets the standard help for the **Get-Item** cmdlet. +```powershell PS C:\> Get-Item +``` +```Output NAME Get-Item @@ -299,7 +330,8 @@ You can also get provider-specific help for cmdlets online in the section that d For example, for provider-specific online help for the New-Item cmdlet in each WSMan provider path, see http://go.microsoft.com/fwlink/?LinkID=158676http://go.microsoft.com/fwlink/?LinkID=158676. ### Example 14 -``` + +```powershell PS C:\> Get-Help C:\PS-Test\MyScript.ps1 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md b/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md index c7b869056476..858226057aa6 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md @@ -11,47 +11,55 @@ title: Get-Help # Get-Help ## SYNOPSIS + Displays information about Windows PowerShell commands and concepts. ## SYNTAX ### AllUsersView (Default) -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Full] [] ``` ### DetailedView -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Detailed] [] ``` ### Examples -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Examples] [] ``` ### Parameters -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] -Parameter [] ``` ### Online -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Online] [] ``` ### ShowWindow -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-ShowWindow] [] ``` ## DESCRIPTION + The **Get-Help** cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, functions, CIM commands, workflows, providers, aliases and scripts. To get help for a Windows PowerShell command, type `Get-Help` followed by the command name, such as: `Get-Help Get-Process`. @@ -95,21 +103,24 @@ To get About topics in a module, import the module, either by using the Import-M ## EXAMPLES ### Example 1: Display help about the help system -``` + +```powershell PS C:\> Get-Help ``` This command displays help about the Windows PowerShell help system. ### Example 2: Display available help topics -``` + +```powershell PS C:\> Get-Help * ``` This command displays a list of the available help topics. ### Example 3: Display basic information about a cmdlet -``` + +```powershell PS C:\> Get-Help Get-Alias PS C:\> Help Get-Alias PS C:\> Get-Alias -? @@ -120,7 +131,8 @@ The **Get-Help** and *?* commands display the information on a single page. The Help command displays the information one page at a time. ### Example 4: Display a list of conceptual topics -``` + +```powershell PS C:\> Get-Help about_* ``` @@ -132,9 +144,13 @@ This command displays the conceptual topics only when the help files for those t For information about downloading and installing help files in Windows PowerShell 3.0, see Update-Help. ### Example 5: Download and install help files -``` + The first command uses the **Get-Help** cmdlet to get help for the Get-Command cmdlet. Without help files, **Get-Help** display the cmdlet name, syntax and alias of **Get-Command**, and prompts you to use the **Update-Help** cmdlet to get the newest help files. +```powershell PS C:\> Get-Help Get-Command +``` + +```Output NAME Get-Command @@ -160,11 +176,15 @@ REMARKS Get-Help cannot find the help files for this cmdlet on this computer. It is displaying only partial help. To download and install help files for this cmdlet, use **Update-Help**. +``` The second command runs the **Update-Help** cmdlet without parameters. This command downloads help files from the Internet for all of the modules in the current session and installs them on the local computer.This command works only when the local computer is connected to the Internet. If your computer is not connected to the Internet, you might be able to install help files from a network share. For more information, see Save-Help. +```powershell PS C:\> Update-Help +``` Now that the help files are downloaded, we can repeat the first command in the sequence. This command gets help for the **Get-Command** cmdlet. The cmdlet now gets more extensive help for **Get-Command** and you can use the *Detailed*, *Full*, *Example*, and *Parameter* parameters of **Get-Help** to customize the displays.You can use the **Get-Help** cmdlet as soon as the **Update-Help** command finishes. You do not have to restart Windows PowerShell. +```powershell PS C:\> Get-Help Get-Command ``` @@ -179,7 +199,8 @@ If you are not a member of the Administrators group on the computer, you cannot However, you can use the *Online* parameter to open the online version of help for a command, and you can read the help for Windows PowerShell in the TechNet library starting at Scripting with Windows PowerShellhttp://go.microsoft.com/fwlink/?LinkID=107116 (http://go.microsoft.com/fwlink/?LinkID=107116). ### Example 6: Display detailed help -``` + +```powershell PS C:\> Get-Help ls -Detailed ``` @@ -190,7 +211,8 @@ To see the complete help topic for a cmdlet, use the *Full* parameter. The *Full* and *Detailed* parameters are effective only when help files for the command are installed on the computer. ### Example 7: Display full information for a cmdlet -``` + +```powershell PS C:\> Get-Help Format-Table -Full ``` @@ -200,7 +222,8 @@ The full view of help includes parameter descriptions, examples, and a table of The *Full* parameter is effective only when help files for the command are installed on the computer. ### Example 8: Display examples for a cmdlet -``` + +```powershell PS C:\> Get-Help Start-Service -Examples ``` @@ -210,7 +233,8 @@ It uses the *Examples* parameter of **Get-Help** to display only the Examples se The *Examples* parameter is effective only when help files for the command are installed on the computer. ### Example 9: Display parameter help -``` + +```powershell PS C:\> Get-Help Format-List -Parameter GroupBy ``` @@ -218,7 +242,8 @@ This command uses the *Parameter* parameter of **Get-Help** to display a detaile For detailed descriptions of all parameters of the **Format-List** cmdlet, type `Get-Help Format-List -Parameter *`. ### Example 10: Search for a word in cmdlet help -``` + +```powershell PS C:\> Get-Help Add-Member -Full | Out-String -Stream | Select-String -Pattern Clixml ``` @@ -228,14 +253,16 @@ This command searches for the word Clixml in the full version of the help topic Because the **Get-Help** cmdlet generates a **MamlCommandHelpInfo** object, not a string, you have to use a cmdlet that transforms the help topic content into a string, such as Out-String or Out-File. ### Example 11: Display online version of help -``` + +```powershell PS C:\> Get-Help Get-Member -Online ``` This command displays the online version of the help topic for the Get-Member cmdlet. ### Example 12: Display a list of topics that include a word -``` + +```powershell PS C:\> Get-Help remoting ``` @@ -244,10 +271,13 @@ This command displays a list of topics that include the word remoting. When you enter a word that does not appear in any topic title, **Get-Help** displays a list of topics that include that word. ### Example 13: Display provider specific help -``` + The first command uses the *Path* parameter of **Get-Help** to specify the provider path. This command can be entered at any path location. +```powershell PS C:\> Get-Help Get-Item -Path SQLSERVER:\DataCollection +``` +```Output NAME Get-Item @@ -277,11 +307,14 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... - +``` The third command shows that a **Get-Help** command in a file system path, and without the *Path* parameter, gets the standard help for the **Get-Item** cmdlet. +```powershell PS C:\> Get-Item +``` +```Output NAME Get-Item @@ -300,7 +333,8 @@ You can also get provider-specific help for cmdlets online in the section that d For example, for provider-specific online help for the **New-Item** cmdlet in each WSMan provider path, see New-Item for ClientCertificatehttp://go.microsoft.com/fwlink/?LinkID=158676 in the TechNet library. ### Example 14: Display help for a script -``` + +```powershell PS C:\> Get-Help C:\PS-Test\MyScript.ps1 ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md index 7288c23a4907..fccc3c9964b1 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md @@ -11,47 +11,55 @@ title: Get-Help # Get-Help ## SYNOPSIS + Displays information about Windows PowerShell commands and concepts. ## SYNTAX ### AllUsersView (Default) -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Full] [] ``` ### DetailedView -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Detailed] [] ``` ### Examples -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Examples] [] ``` ### Parameters -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] -Parameter [] ``` ### Online -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Online] [] ``` ### ShowWindow -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-ShowWindow] [] ``` ## DESCRIPTION + The **Get-Help** cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, functions, CIM commands, workflows, providers, aliases and scripts. To get help for a Windows PowerShell command, type `Get-Help` followed by the command name, such as: `Get-Help Get-Process`. @@ -95,21 +103,24 @@ To get About topics in a module, import the module, either by using the Import-M ## EXAMPLES ### Example 1: Display help about the help system -``` + +```powershell PS C:\> Get-Help ``` This command displays help about the Windows PowerShell help system. ### Example 2: Display available help topics -``` + +```powershell PS C:\> Get-Help * ``` This command displays a list of the available help topics. ### Example 3: Display basic information about a cmdlet -``` + +```powershell PS C:\> Get-Help Get-Alias PS C:\> Help Get-Alias PS C:\> Get-Alias -? @@ -120,7 +131,8 @@ The **Get-Help** and *?* commands display the information on a single page. The Help command displays the information one page at a time. ### Example 4: Display a list of conceptual topics -``` + +```powershell PS C:\> Get-Help about_* ``` @@ -132,9 +144,13 @@ This command displays the conceptual topics only when the help files for those t For information about downloading and installing help files in Windows PowerShell 3.0, see Update-Help. ### Example 5: Download and install help files -``` + The first command uses the **Get-Help** cmdlet to get help for the Get-Command cmdlet. Without help files, **Get-Help** display the cmdlet name, syntax and alias of **Get-Command**, and prompts you to use the **Update-Help** cmdlet to get the newest help files. +```powershell PS C:\> Get-Help Get-Command +``` + +```Output NAME Get-Command @@ -160,11 +176,15 @@ REMARKS Get-Help cannot find the help files for this cmdlet on this computer. It is displaying only partial help. To download and install help files for this cmdlet, use **Update-Help**. +``` The second command runs the **Update-Help** cmdlet without parameters. This command downloads help files from the Internet for all of the modules in the current session and installs them on the local computer.This command works only when the local computer is connected to the Internet. If your computer is not connected to the Internet, you might be able to install help files from a network share. For more information, see Save-Help. +```powershell PS C:\> Update-Help +``` Now that the help files are downloaded, we can repeat the first command in the sequence. This command gets help for the **Get-Command** cmdlet. The cmdlet now gets more extensive help for **Get-Command** and you can use the *Detailed*, *Full*, *Example*, and *Parameter* parameters of **Get-Help** to customize the displays.You can use the **Get-Help** cmdlet as soon as the **Update-Help** command finishes. You do not have to restart Windows PowerShell. +```powershell PS C:\> Get-Help Get-Command ``` @@ -179,7 +199,8 @@ If you are not a member of the Administrators group on the computer, you cannot However, you can use the *Online* parameter to open the online version of help for a command, and you can read the help for Windows PowerShell in the TechNet library starting at Scripting with Windows PowerShellhttp://go.microsoft.com/fwlink/?LinkID=107116 (http://go.microsoft.com/fwlink/?LinkID=107116). ### Example 6: Display detailed help -``` + +```powershell PS C:\> Get-Help ls -Detailed ``` @@ -190,7 +211,8 @@ To see the complete help topic for a cmdlet, use the *Full* parameter. The *Full* and *Detailed* parameters are effective only when help files for the command are installed on the computer. ### Example 7: Display full information for a cmdlet -``` + +```powershell PS C:\> Get-Help Format-Table -Full ``` @@ -200,7 +222,8 @@ The full view of help includes parameter descriptions, examples, and a table of The *Full* parameter is effective only when help files for the command are installed on the computer. ### Example 8: Display examples for a cmdlet -``` + +```powershell PS C:\> Get-Help Start-Service -Examples ``` @@ -210,7 +233,8 @@ It uses the *Examples* parameter of **Get-Help** to display only the Examples se The *Examples* parameter is effective only when help files for the command are installed on the computer. ### Example 9: Display parameter help -``` + +```powershell PS C:\> Get-Help Format-List -Parameter GroupBy ``` @@ -218,7 +242,8 @@ This command uses the *Parameter* parameter of **Get-Help** to display a detaile For detailed descriptions of all parameters of the **Format-List** cmdlet, type `Get-Help Format-List -Parameter *`. ### Example 10: Search for a word in cmdlet help -``` + +```powershell PS C:\> Get-Help Add-Member -Full | Out-String -Stream | Select-String -Pattern Clixml ``` @@ -228,14 +253,16 @@ This command searches for the word Clixml in the full version of the help topic Because the **Get-Help** cmdlet generates a **MamlCommandHelpInfo** object, not a string, you have to use a cmdlet that transforms the help topic content into a string, such as Out-String or Out-File. ### Example 11: Display online version of help -``` + +```powershell PS C:\> Get-Help Get-Member -Online ``` This command displays the online version of the help topic for the Get-Member cmdlet. ### Example 12: Display a list of topics that include a word -``` + +```powershell PS C:\> Get-Help remoting ``` @@ -244,10 +271,13 @@ This command displays a list of topics that include the word remoting. When you enter a word that does not appear in any topic title, **Get-Help** displays a list of topics that include that word. ### Example 13: Display provider specific help -``` + The first command uses the *Path* parameter of **Get-Help** to specify the provider path. This command can be entered at any path location. +```powershell PS C:\> Get-Help Get-Item -Path SQLSERVER:\DataCollection +``` +```Output NAME Get-Item @@ -260,11 +290,15 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... +``` The second command uses the Set-Location cmdlet (alias = "cd") to navigate to the provider path. From that location, even without the *Path* parameter, the **Get-Help** command gets the provider-specific help for the **Get-Item** cmdlet. +```powershell PS C:\> cd SQLSERVER:\DataCollection SQLSERVER:\DataCollection> Get-Help Get-Item +``` +```Output NAME Get-Item @@ -277,11 +311,14 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... - +``` The third command shows that a **Get-Help** command in a file system path, and without the *Path* parameter, gets the standard help for the **Get-Item** cmdlet. +```powershell PS C:\> Get-Item +``` +```Output NAME Get-Item @@ -300,7 +337,8 @@ You can also get provider-specific help for cmdlets online in the section that d For example, for provider-specific online help for the **New-Item** cmdlet in each WSMan provider path, see New-Item for ClientCertificatehttp://go.microsoft.com/fwlink/?LinkID=158676 in the TechNet library. ### Example 14: Display help for a script -``` + +```powershell PS C:\> Get-Help C:\PS-Test\MyScript.ps1 ``` diff --git a/reference/6/Microsoft.PowerShell.Core/Get-Help.md b/reference/6/Microsoft.PowerShell.Core/Get-Help.md index f6ee740efbf4..4bae7162e64d 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-Help.md @@ -11,41 +11,48 @@ title: Get-Help # Get-Help ## SYNOPSIS + Displays information about Windows PowerShell commands and concepts. ## SYNTAX ### AllUsersView (Default) -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Full] [] ``` ### DetailedView -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Detailed] [] ``` ### Examples -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Examples] [] ``` ### Parameters -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] -Parameter [] ``` ### Online -``` + +```powershell Get-Help [[-Name] ] [-Path ] [-Category ] [-Component ] [-Functionality ] [-Role ] [-Online] [] ``` ## DESCRIPTION + The **Get-Help** cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, functions, CIM commands, workflows, providers, aliases and scripts. To get help for a Windows PowerShell command, type `Get-Help` followed by the command name, such as: `Get-Help Get-Process`. @@ -89,21 +96,24 @@ To get About topics in a module, import the module, either by using the Import-M ## EXAMPLES ### Example 1: Display help about the help system -``` + +```powershell PS C:\> Get-Help ``` This command displays help about the Windows PowerShell help system. ### Example 2: Display available help topics -``` + +```powershell PS C:\> Get-Help * ``` This command displays a list of the available help topics. ### Example 3: Display basic information about a cmdlet -``` + +```powershell PS C:\> Get-Help Get-Alias PS C:\> Help Get-Alias PS C:\> Get-Alias -? @@ -114,7 +124,8 @@ The **Get-Help** and *?* commands display the information on a single page. The Help command displays the information one page at a time. ### Example 4: Display a list of conceptual topics -``` + +```powershell PS C:\> Get-Help about_* ``` @@ -126,9 +137,13 @@ This command displays the conceptual topics only when the help files for those t For information about downloading and installing help files in Windows PowerShell 3.0, see Update-Help. ### Example 5: Download and install help files -``` + The first command uses the **Get-Help** cmdlet to get help for the Get-Command cmdlet. Without help files, **Get-Help** display the cmdlet name, syntax and alias of **Get-Command**, and prompts you to use the **Update-Help** cmdlet to get the newest help files. +```powershell PS C:\> Get-Help Get-Command +``` + +```Output NAME Get-Command @@ -154,11 +169,15 @@ REMARKS Get-Help cannot find the help files for this cmdlet on this computer. It is displaying only partial help. To download and install help files for this cmdlet, use **Update-Help**. +``` The second command runs the **Update-Help** cmdlet without parameters. This command downloads help files from the Internet for all of the modules in the current session and installs them on the local computer.This command works only when the local computer is connected to the Internet. If your computer is not connected to the Internet, you might be able to install help files from a network share. For more information, see Save-Help. +```powershell PS C:\> Update-Help +``` Now that the help files are downloaded, we can repeat the first command in the sequence. This command gets help for the **Get-Command** cmdlet. The cmdlet now gets more extensive help for **Get-Command** and you can use the *Detailed*, *Full*, *Example*, and *Parameter* parameters of **Get-Help** to customize the displays.You can use the **Get-Help** cmdlet as soon as the **Update-Help** command finishes. You do not have to restart Windows PowerShell. +```powershell PS C:\> Get-Help Get-Command ``` @@ -173,7 +192,8 @@ If you are not a member of the Administrators group on the computer, you cannot However, you can use the *Online* parameter to open the online version of help for a command, and you can read the help for Windows PowerShell in the TechNet library starting at Scripting with Windows PowerShellhttp://go.microsoft.com/fwlink/?LinkID=107116 (http://go.microsoft.com/fwlink/?LinkID=107116). ### Example 6: Display detailed help -``` + +```powershell PS C:\> Get-Help ls -Detailed ``` @@ -184,7 +204,8 @@ To see the complete help topic for a cmdlet, use the *Full* parameter. The *Full* and *Detailed* parameters are effective only when help files for the command are installed on the computer. ### Example 7: Display full information for a cmdlet -``` + +```powershell PS C:\> Get-Help Format-Table -Full ``` @@ -194,7 +215,8 @@ The full view of help includes parameter descriptions, examples, and a table of The *Full* parameter is effective only when help files for the command are installed on the computer. ### Example 8: Display examples for a cmdlet -``` + +```powershell PS C:\> Get-Help Start-Service -Examples ``` @@ -204,7 +226,8 @@ It uses the *Examples* parameter of **Get-Help** to display only the Examples se The *Examples* parameter is effective only when help files for the command are installed on the computer. ### Example 9: Display parameter help -``` + +```powershell PS C:\> Get-Help Format-List -Parameter GroupBy ``` @@ -212,7 +235,8 @@ This command uses the *Parameter* parameter of **Get-Help** to display a detaile For detailed descriptions of all parameters of the **Format-List** cmdlet, type `Get-Help Format-List -Parameter *`. ### Example 10: Search for a word in cmdlet help -``` + +```powershell PS C:\> Get-Help Add-Member -Full | Out-String -Stream | Select-String -Pattern Clixml ``` @@ -222,14 +246,16 @@ This command searches for the word Clixml in the full version of the help topic Because the **Get-Help** cmdlet generates a **MamlCommandHelpInfo** object, not a string, you have to use a cmdlet that transforms the help topic content into a string, such as Out-String or Out-File. ### Example 11: Display online version of help -``` + +```powershell PS C:\> Get-Help Get-Member -Online ``` This command displays the online version of the help topic for the Get-Member cmdlet. ### Example 12: Display a list of topics that include a word -``` + +```powershell PS C:\> Get-Help remoting ``` @@ -238,10 +264,13 @@ This command displays a list of topics that include the word remoting. When you enter a word that does not appear in any topic title, **Get-Help** displays a list of topics that include that word. ### Example 13: Display provider specific help -``` + The first command uses the *Path* parameter of **Get-Help** to specify the provider path. This command can be entered at any path location. +```powershell PS C:\> Get-Help Get-Item -Path SQLSERVER:\DataCollection +``` +```Output NAME Get-Item @@ -254,11 +283,15 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... +``` The second command uses the Set-Location cmdlet (alias = "cd") to navigate to the provider path. From that location, even without the *Path* parameter, the **Get-Help** command gets the provider-specific help for the **Get-Item** cmdlet. +```powershell PS C:\> cd SQLSERVER:\DataCollection SQLSERVER:\DataCollection> Get-Help Get-Item +``` +```Output NAME Get-Item @@ -271,11 +304,14 @@ SYNOPSIS to which you have made a SQL Server PowerShell connection. ... - +``` The third command shows that a **Get-Help** command in a file system path, and without the *Path* parameter, gets the standard help for the **Get-Item** cmdlet. +```powershell PS C:\> Get-Item +``` +```Output NAME Get-Item @@ -294,7 +330,8 @@ You can also get provider-specific help for cmdlets online in the section that d For example, for provider-specific online help for the **New-Item** cmdlet in each WSMan provider path, see New-Item for ClientCertificatehttp://go.microsoft.com/fwlink/?LinkID=158676 in the TechNet library. ### Example 14: Display help for a script -``` + +```powershell PS C:\> Get-Help C:\PS-Test\MyScript.ps1 ```