InvocationInfo Class

Definition

Describes how and where this command was invoked

public class InvocationInfo
Inheritance
InvocationInfo

Properties

BoundParameters

This member provides a dictionary of the parameters that were bound for this script or command.

CommandOrigin

This property tells you if you were being invoked inside the runspace or if it was an external request.

DisplayScriptPosition

The position for the invocation or error.

ExpectingInput

Is true if this command is expecting input...

HistoryId

History ID that represents the command. If unavailable, this will be -1.

InvocationName

Command name used to invoke this string - if invoked through an alias, then this would be the alias name.

Line

The text of the line that contained this cmdlet invocation.

MyCommand

Provide basic information about the command

OffsetInLine

Command's character offset in that line. If the command was executed directly through the host interfaces, this will be -1.

PipelineLength

How many elements are in the containing pipeline

PipelinePosition

which element this command was in the containing pipeline

PositionMessage

Formatted message indicating where the cmdlet appeared in the line

PSCommandPath

This property tells you the full path to the command from where you were being invoked

PSScriptRoot

This property tells you the directory from where you were being invoked

ScriptLineNumber

The line number in the executing script that contained this cmdlet.

ScriptName

The name of the script containing the cmdlet.

UnboundArguments

This member provides a list of the arguments that were not bound to any parameter

Methods

Create(CommandInfo, IScriptExtent)