C# Class PoshCode.PoshConsole

Inheritance: PoshCode.Controls.ConsoleControl, IRichConsole
Afficher le fichier Open project: Jaykul/PoshConsole

Méthodes publiques

Свойство Type Description
ContentProperty System.Windows.DependencyProperty
ProgressProperty System.Windows.DependencyProperty

Private Properties

Свойство Type Description
BuildHotkeysAndPlainLabels ].string[
GetHotkeyAndLabel string[]
GetSingle System.Management.Automation.PSObject
TryConvertTo System.Management.Automation.PSInvalidCastException

Méthodes publiques

Méthode Description
Invoke ( string script, ConsoleOutput output = ConsoleOutput.Default ) : Collection

Invoke the specified script, synchronously, and return the pipeline output.

InvokeAsync ( Command commands, IEnumerable input = null, ConsoleOutput output = ConsoleOutput.Default ) : Task

Invoke the specified commands in a pipeline asynchronously, optionally providing input to the first command, and with the specified output handling.

InvokeAsync ( string command, bool isScript = true, bool useLocalScope = false, IEnumerable input = null, ConsoleOutput output = ConsoleOutput.Default ) : Task

Invoke the specified command in a pipeline asynchronously, optionally providing input to the first command, and with the specified output handling.

OnPromptForChoice ( PromptForChoiceEventArgs e ) : int
OnPromptForObject ( PromptForObjectEventArgs e ) : PSObject>.Dictionary
PoshConsole ( ) : System
PromptForCredentialInline ( string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes = PSCredentialTypes.Generic, PSCredentialUIOptions options = PSCredentialUIOptions.None ) : System.Management.Automation.PSCredential
WriteErrorRecord ( ErrorRecord errorRecord ) : void
WriteErrorRecords ( Collection errorRecords ) : void

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void
OnCommand ( CommandEventArgs command ) : void
OnInitialized ( EventArgs e ) : void

Private Methods

Méthode Description
BuildHotkeysAndPlainLabels ( Collection choices, bool addHelp ) : ].string[

This is a private worker function that splits out the accelerator keys from the menu and builds a two dimentional array with the first access containing the accelerator and the second containing the label string with & removed.

GetHotkeyAndLabel ( string input ) : string[]

Parse a string containing a hotkey character. Take a string of the form: "Yes to &all" And return a two-dimensional array split out as "A", "Yes to all".

GetSingle ( string caption, string message, string prompt, System.Management.Automation.Host.FieldDescription field, Type type ) : System.Management.Automation.PSObject
TryConvertTo ( Type type, string input, object &output ) : System.Management.Automation.PSInvalidCastException

Method Details

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Invoke() public méthode

Invoke the specified script, synchronously, and return the pipeline output.
public Invoke ( string script, ConsoleOutput output = ConsoleOutput.Default ) : Collection
script string The script from which the pipeline will be constructed. Can be just a command name, but is executed as though typed on the console.
output ConsoleOutput Optionally: what to print to the console (prints everything, by default, as though the user had typed the commands in the console)
Résultat Collection

InvokeAsync() public méthode

Invoke the specified commands in a pipeline asynchronously, optionally providing input to the first command, and with the specified output handling.
public InvokeAsync ( Command commands, IEnumerable input = null, ConsoleOutput output = ConsoleOutput.Default ) : Task
commands Command Commands from which the pipeline will be constructed
input IEnumerable Optional Pipeline Input. If this is specified, your first command must accept pipeline input
output ConsoleOutput Optionally: what to print to the console (prints everything, by default, as though the user had typed the commands in the console)
Résultat Task

InvokeAsync() public méthode

Invoke the specified command in a pipeline asynchronously, optionally providing input to the first command, and with the specified output handling.
public InvokeAsync ( string command, bool isScript = true, bool useLocalScope = false, IEnumerable input = null, ConsoleOutput output = ConsoleOutput.Default ) : Task
command string The Command from which the pipeline will be constructed.
isScript bool Whether the command is a script (defaults to true). You should set this to false if you are just naming a command.
useLocalScope bool Whether the command should use it's own local scope -- only valid for scripts (defaults to false)
input IEnumerable Optional Pipeline Input. If this is specified, your first command must accept pipeline input
output ConsoleOutput Optionally: what to print to the console (prints everything, by default, as though the user had typed the commands in the console)
Résultat Task

OnCommand() protected méthode

protected OnCommand ( CommandEventArgs command ) : void
command PoshCode.Controls.CommandEventArgs
Résultat void

OnInitialized() protected méthode

protected OnInitialized ( EventArgs e ) : void
e System.EventArgs
Résultat void

OnPromptForChoice() public méthode

public OnPromptForChoice ( PromptForChoiceEventArgs e ) : int
e PoshCode.Controls.PromptForChoiceEventArgs
Résultat int

OnPromptForObject() public méthode

public OnPromptForObject ( PromptForObjectEventArgs e ) : PSObject>.Dictionary
e PoshCode.Controls.PromptForObjectEventArgs
Résultat PSObject>.Dictionary

PoshConsole() public méthode

public PoshConsole ( ) : System
Résultat System

PromptForCredentialInline() public méthode

public PromptForCredentialInline ( string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes = PSCredentialTypes.Generic, PSCredentialUIOptions options = PSCredentialUIOptions.None ) : System.Management.Automation.PSCredential
caption string
message string
userName string
targetName string
allowedCredentialTypes PSCredentialTypes
options PSCredentialUIOptions
Résultat System.Management.Automation.PSCredential

WriteErrorRecord() public méthode

public WriteErrorRecord ( ErrorRecord errorRecord ) : void
errorRecord System.Management.Automation.ErrorRecord
Résultat void

WriteErrorRecords() public méthode

public WriteErrorRecords ( Collection errorRecords ) : void
errorRecords Collection
Résultat void

Property Details

ContentProperty public_oe static_oe property

public static DependencyProperty,System.Windows ContentProperty
Résultat System.Windows.DependencyProperty

ProgressProperty public_oe static_oe property

public static DependencyProperty,System.Windows ProgressProperty
Résultat System.Windows.DependencyProperty