Describes the notation used for Windows PowerShell syntax in Help. (about_Command_Syntax)

   
# TOPIC
about_Command_Syntax

# SHORT DESCRIPTION
Describes the notation used for Windows PowerShell syntax in Help.

# LONG DESCRIPTION
The Get-Help cmdlet displays the parameter usage for a cmdlet. The Get-Help
cmdlet uses the following special symbols:

Angle brackets (<>) indicate placeholder text.
Brackets ([]) indicate optional items.
Braces ({}) indicate a choice among values.

Some cmdlets have more than one set of parameters. Distinct parameter sets
can share some parameters. The Get-Help cmdlet displays all the parameter
sets for a cmdlet.

You can find additional information about a parameter in the parameter
description and in the parameter attribute table. To view complete
information about a parameter, use the Full or Parameter parameters of
Get-Help.

Syntax
Windows PowerShell cmdlet Help, Help topics, and other documentation use
the following notation for cmdlets in syntax descriptions.

<cmdlet name> -<Required Parameter name> <Required parameter Value>
[-<Optional Parameter name> <Optional Parameter Value>]
[-<Optional Switch Parameter>]
[-<Optional Parameter Name>] <Required parameter Value>

The following is the syntax for the New-Alias cmdlet.

New-Alias [-Force] [-PassThru] [-Scope <string>]
[-Option {None | ReadOnly | Constant | Private | AllScope}]
[-Description <string>] [-Name] <string> [-Value] <string>
[-confirm] [-whatif] [<CommonParameters>]

The syntax is capitalized for readability, but Windows Powershell is
case-insensitive.

Parameters appear in order. The order of parameters is significant only
when the parameter names are optional. If you do not specify parameter
names when you use a cmdlet, Windows PowerShell assigns values to
parameters by position and by type.

Parameter names are preceded by a hyphen (-). Switch parameters appear
without a value type. Other parameters appear with the Microsoft .NET
Framework type of the argument required or with an enumeration of
possible values. For more information about .NET Framework types,
see http://go.microsoft.com/fwlink/?LinkId=143682.

Angle brackets (<>) indicate placeholder text. This text can describe the
type of an item (such as a string or a Process object). It can also be a
placeholder for one or more common parameters.

Brackets ([]) indicate optional items. A parameter can be optional, or
the name of a required parameter can be optional. Switch parameters are
always optional.

Braces ({}) appear around the values of an enumeration. In the example of
the New-Alias cmdlet, the Option parameter can have any of the listed
values.

Optional Items
Brackets ([]) surround optional items. For example, in the New-Alias
cmdlet syntax description, the Scope parameter is optional. This is
indicated in the syntax by the brackets around the parameter name
and type:

[-Scope <string>]

Both the following examples are correct uses of the New-Alias cmdlet:

New-Alias -Name utd -Value Update-TypeData
New-Alias -Name utd -Value Update-TypeData -Scope global

A parameter name can be optional even if the value for that parameter is
required. This is indicated in the syntax by the brackets around the
parameter name but not the parameter type, as in this example from the
New-Alias cmdlet:

[-Name] <string> [-Value] <string>

The following commands correctly use the New-Alias cmdlet. The commands
produce the same result:

New-Alias -Name utd -Value Update-TypeData
New-Alias -Name utd Update-TypeData
New-Alias utd -Value Update-TypeData
New-Alias utd Update-TypeData

If the parameter name is not included in the statement as typed, Windows
PowerShell tries to use the position of the arguments to assign the
values to parameters.

The following example is not complete:

New-Alias utd

This cmdlet requires values for both the Name and Value parameters.

In syntax examples, brackets are also used in naming and casting to
.NET Framework types. In this context, brackets do not indicate an
element is optional.

Array Arguments
Brackets are also used in syntax descriptions to represent an array.
The following example shows the syntax for the Restart-Service cmdlet:

Restart-Service [-Name] <string[]> [-Include <string[]>]
[-Exclude <string[]>] [-Force] [-PassThru] [-Confirm] [-WhatIf]
[<CommonParameters>]

The Name parameter requires an argument. Specifically, it requires the
name of the service to be restarted. It can take a comma-separated list
of services, as in the following example:

Restart-Service RasAuto, RasMan, RemoteAccess

SEE ALSO
Get-Help

C:\Windows>powershell get-help about_Comment_Based_Help -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows 10, 8.1, 8, 7, Vista / Windows Server 2016, 2012, 2008
»»»» ColorConsole








Windows-10





Windows-10

... facebook.de
... Windows-10 FAQ
... Windows-10 Info


Become a Sponsor
... Your button here?





PowerShell: Describes the notation used for Windows PowerShell syntax in Help.

HTTP: ... PS_Windows/en/about_Command_Syntax.htm
0.311
14974

Volume control in the notification area of ​​the taskbar activate / deactivate!

 /

Difference between Save Current State and Save Current State at Desktop Item?

 /

Installing a printer with own drivers, using HP as an example under Win 10, 8.1, 7!

 /

How to scans all protected system files (command-line)?

 /

Unterschied zwischen Qualität und Leistung beim Bildvergleich?

 /

Can I close the open Store Apps in Windows-8 Metro from the Switch List?

 /

Does BIN to ISO support MODE2 / 2352 and MODE1 / 2048 ISO9660 UDF?

 /

Open and start Internet Explorer always on Windows 8.1 / 10 desktop (turn off Metro App)!

 /

Change the Windows folder icons RGB color!

 /

Can my MS-Surface with Windows 10 be damaged by the tiny insects?

 /

Find Character Map for Windows 10? (start, run, download)

 /

USA football mouse tracks!

 /