C# Class NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher

Wraps a runspace and protects the invoke method from being called on multiple threads through blocking.
Calls to Invoke on this object will block if the runspace is already busy. Calls to InvokeAsync will also block until the runspace is free. However, it will not block while the pipeline is actually running.
Inheritance: IDisposable
Afficher le fichier Open project: xero-github/Nuget Class Usage Examples

Méthodes publiques

Méthode Description
ChangePSDirectory ( string directory ) : void
Dispose ( ) : void
ExecuteScript ( string installPath, string scriptPath, IPackage package ) : void
ExtractErrorFromErrorRecord ( ErrorRecord record ) : string
GetEffectiveExecutionPolicy ( ) : ExecutionPolicy
GetExecutionPolicy ( ExecutionPolicyScope scope ) : ExecutionPolicy
ImportModule ( string modulePath ) : void
Invoke ( string command, object inputs, bool outputResults ) : Collection
InvokeCommands ( System.Management.Automation.PSCommand profileCommands ) : void
MakeDefault ( ) : void
RunspaceDispatcher ( System.Management.Automation.Runspaces.Runspace runspace ) : System
SetExecutionPolicy ( ExecutionPolicy policy, ExecutionPolicyScope scope ) : void

Private Methods

Méthode Description
CreatePipeline ( string command, bool outputResults ) : System.Management.Automation.Runspaces.Pipeline
GetExecutionPolicy ( string command ) : ExecutionPolicy
InvokeAsync ( string command, object inputs, bool outputResults, EventHandler pipelineStateChanged ) : System.Management.Automation.Runspaces.Pipeline
InvokeCore ( System.Management.Automation.Runspaces.Pipeline pipeline, IEnumerable inputs ) : Collection
InvokeCoreAsync ( System.Management.Automation.Runspaces.Pipeline pipeline, IEnumerable inputs ) : void

Method Details

ChangePSDirectory() public méthode

public ChangePSDirectory ( string directory ) : void
directory string
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

ExecuteScript() public méthode

public ExecuteScript ( string installPath, string scriptPath, IPackage package ) : void
installPath string
scriptPath string
package IPackage
Résultat void

ExtractErrorFromErrorRecord() public méthode

public ExtractErrorFromErrorRecord ( ErrorRecord record ) : string
record System.Management.Automation.ErrorRecord
Résultat string

GetEffectiveExecutionPolicy() public méthode

public GetEffectiveExecutionPolicy ( ) : ExecutionPolicy
Résultat ExecutionPolicy

GetExecutionPolicy() public méthode

public GetExecutionPolicy ( ExecutionPolicyScope scope ) : ExecutionPolicy
scope ExecutionPolicyScope
Résultat ExecutionPolicy

ImportModule() public méthode

public ImportModule ( string modulePath ) : void
modulePath string
Résultat void

Invoke() public méthode

public Invoke ( string command, object inputs, bool outputResults ) : Collection
command string
inputs object
outputResults bool
Résultat Collection

InvokeCommands() public méthode

public InvokeCommands ( System.Management.Automation.PSCommand profileCommands ) : void
profileCommands System.Management.Automation.PSCommand
Résultat void

MakeDefault() public méthode

public MakeDefault ( ) : void
Résultat void

RunspaceDispatcher() public méthode

public RunspaceDispatcher ( System.Management.Automation.Runspaces.Runspace runspace ) : System
runspace System.Management.Automation.Runspaces.Runspace
Résultat System

SetExecutionPolicy() public méthode

public SetExecutionPolicy ( ExecutionPolicy policy, ExecutionPolicyScope scope ) : void
policy ExecutionPolicy
scope ExecutionPolicyScope
Résultat void