Partilhar via


PSTokenType Enum

Definition

PowerShell token types.

public enum class PSTokenType
public enum PSTokenType
type PSTokenType = 
Public Enum PSTokenType
Inheritance
PSTokenType

Fields

Name Value Description
Unknown 0

Unknown token.

Command 1

Command.

CommandParameter 2

Command Parameter.

For example, '-name' in

get-process -name foo

CommandArgument 3

Command Argument.

For example, 'foo' in

get-process -name foo

Number 4

Number.

For example, 12 in

$a=12

String 5

String.

For example, "12" in

$a="12"

Variable 6

Variable.

Member 7

Property name or method name.

For example, Name in

$a.Name

LoopLabel 8

Loop label.

Attribute 9

Attributes.

For example, Mandatory in

param([Mandatory] $a)

Type 10

Types.

For example, [string] in

$a = [string] 12

Operator 11

Operators.

For example, + in

$a = 1 + 2

GroupStart 12

Group Starter.

For example, { in

if ($a -gt 4)
{
    $a++;
}

GroupEnd 13

Group Ender.

For example, } in

if ($a -gt 4)
{
    $a++;
}

Keyword 14

Keyword.

For example, if in

if ($a -gt 4)
{
    $a++;
}

Comment 15

Comment.

For example, #here in

#here
if ($a -gt 4)
{
    $a++;
}

StatementSeparator 16

Statement separator. This is ';'

For example, ; in

#here
if ($a -gt 4)
{
    $a++;
}

NewLine 17

New line. This is '\n'

For example, \n in

#here
if ($a -gt 4)
{
    $a++;
}

LineContinuation 18

Line continuation.

For example, ` in

get-command -name `
foo

Position 19

Position token.

Position tokens are bogus tokens generated for identifying a location in the script.

Applies to