Scripting Integrator - Online Help
Scripting Integrator
Questions / Feedback?

PowerShell Component

Properties   Methods   Events   Configuration Settings   Errors  

The PowerShell component can be used as a simple means of hosting the PowerShell scripting engine inside an application.

Syntax

nsoftware.InScript.Powershell

Remarks

PowerShell can be used to execute PowerShell commands on a PowerShell runspace, add variables to the runspace and process the results of the pipeline execution.

Prior to calling Eval or EvalFile any custom functions must be added by calling AddFunction. At the time of execution when the function is called the Function event will fire. Within this event the Parameters property may be queried to obtain information about the function parameters. Calculate the and provide the return value within Function.

By default no profiles are loaded, however LoadProfiles may be set to True to load profiles. The AddVariable method may also be used to add a variable to the running context.

To execute the PowerShell script call Eval or EvalFile. The output is returned by these methods. If any errors occur during processing the Error event will fire.

Eval Notes

When calling Eval or EvalFile any custom functions must first be defined by calling AddFunction. When the function is encountered the Function event will fire. Within this event query the Parameters collection to get the function parameter values. The return value of the custom function is defined within the Function event.

Any errors such as undefined functions or other issue will cause the Error event. Errors will not cause an exception. It is important to monitor the Error event for information about any errors that occur.

The return value from Eval or EvalFile is the output from successful execution of the JavaScript.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

LoadProfilesWhether to load profiles.
ParametersA collection of function parameters when custom function is invoked.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

AddFunctionAdds a custom function.
AddVariableSets the value of a variable in the PowerShell Runspace.
CloseCloses the current PowerShell runspace.
ConfigSets or retrieves a configuration setting .
EvalExecute a command on the PowerShell runspace.
EvalFileExecute a script file on the PowerShell runspace.
InterruptStops the execution of the current command.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorInformation about errors during data delivery.
FunctionFired when a custom function is called.

Configuration Settings


The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.

ProfileIdThe profile Id to look for when loading profiles.
CodePageThe system code page used for Unicode to Multibyte translations.

 
 
Copyright (c) 2017 /n software inc. - All rights reserved.
Build 1.0.6240.0