CommandInvocationIntrinsics CommandInvocationIntrinsics CommandInvocationIntrinsics Class

Definition

Interfaces that cmdlets can use to build script blocks and execute scripts.

public class CommandInvocationIntrinsics
type CommandInvocationIntrinsics = class
Public Class CommandInvocationIntrinsics
Inheritance
CommandInvocationIntrinsicsCommandInvocationIntrinsicsCommandInvocationIntrinsics

Properties

CommandNotFoundAction CommandNotFoundAction CommandNotFoundAction

This event handler is called when a command is not found. If should have a single string parameter that is the name of the command and should return a CommandInfo object or null. By default it will search the module path looking for a module that exports the desired command.

HasErrors HasErrors HasErrors

If an error occurred while executing the cmdlet, this will be set to true.

PostCommandLookupAction PostCommandLookupAction PostCommandLookupAction

This event handler is after the command lookup is done but before the event object is returned to the caller. This allows things like interning scripts to work. If should have a single string parameter that is the name of the command and should return a CommandInfo object or null.

PreCommandLookupAction PreCommandLookupAction PreCommandLookupAction

This event handler is called before the command lookup is done. If should have a single string parameter that is the name of the command and should return a CommandInfo object or null.

Methods

ExpandString(String) ExpandString(String) ExpandString(String)

Returns a string with all of the variable and expression substitutions done.

GetCmdlet(String) GetCmdlet(String) GetCmdlet(String)

Returns the CmdletInfo object that corresponds to the name argument

GetCmdletByTypeName(String) GetCmdletByTypeName(String) GetCmdletByTypeName(String)

Get the cmdlet info using the name of the cmdlet's implementing type. This bypasses session state and retrieves the command directly. Note that the help file and snapin/module info will both be null on returned object.

GetCmdlets() GetCmdlets() GetCmdlets()

Returns a list of all cmdlets...

GetCmdlets(String) GetCmdlets(String) GetCmdlets(String)

Returns all cmdlets whose names match the pattern...

GetCommand(String, CommandTypes) GetCommand(String, CommandTypes) GetCommand(String, CommandTypes)
GetCommand(String, CommandTypes, Object[]) GetCommand(String, CommandTypes, Object[]) GetCommand(String, CommandTypes, Object[])

Returns a command info for a given command name and type, using the specified arguments to resolve dynamic parameters.

GetCommandName(String, Boolean, Boolean) GetCommandName(String, Boolean, Boolean) GetCommandName(String, Boolean, Boolean)

Searches for PowerShell commands, optionally using wildcard patterns and optionally return the full path to applications and scripts rather than the simple command name.

GetCommands(String, CommandTypes, Boolean) GetCommands(String, CommandTypes, Boolean) GetCommands(String, CommandTypes, Boolean)

Searches for PowerShell commands, optionally using wildcard patterns

InvokeScript(String) InvokeScript(String) InvokeScript(String)

Executes a piece of text as a script synchronously.

InvokeScript(String, Object[]) InvokeScript(String, Object[]) InvokeScript(String, Object[])

Executes a piece of text as a script synchronously.

InvokeScript(SessionState, ScriptBlock, Object[]) InvokeScript(SessionState, ScriptBlock, Object[]) InvokeScript(SessionState, ScriptBlock, Object[])
InvokeScript(Boolean, ScriptBlock, IList, Object[]) InvokeScript(Boolean, ScriptBlock, IList, Object[]) InvokeScript(Boolean, ScriptBlock, IList, Object[])

Invoke a scriptblock in the current runspace, controlling if it gets a new scope.

InvokeScript(String, Boolean, PipelineResultTypes, IList, Object[]) InvokeScript(String, Boolean, PipelineResultTypes, IList, Object[]) InvokeScript(String, Boolean, PipelineResultTypes, IList, Object[])

Executes a piece of text as a script synchronously using the options provided.

NewScriptBlock(String) NewScriptBlock(String) NewScriptBlock(String)

Compile a string into a script block.

Applies to