Partager via


CommandAst.GetCommandName Method

Definition

Returns the name of the command invoked by this ast.

This command name may not be known statically, in which case null is returned.

For example, if the command name is in a variable: & $foo, then the parser cannot know which command is executed. Similarly, if the command is being invoked in a module: & (gmo SomeModule) Bar, then the parser does not know the command name is Bar because the parser can't determine that the expression (gmo SomeModule) returns a module instead of a string.

public:
 System::String ^ GetCommandName();
public:
 Platform::String ^ GetCommandName();
std::wstring GetCommandName();
public string GetCommandName ();
member this.GetCommandName : unit -> string
Public Function GetCommandName () As String

Returns

The command name, if known, null otherwise.

Applies to