Class RunPowerShellAction
Represents a plugin prerequisite action that runs a PowerShell script
Note: To run an inline script instead, use RunInlinePowerShellAction
Inherited Members
Namespace: Artemis.Core
Assembly: Artemis.Core.dll
Syntax
public class RunPowerShellAction : PluginPrerequisiteAction
Constructors
RunPowerShellAction(string, string, bool, string?)
Creates a new instance of a copy folder action
Declaration
public RunPowerShellAction(string name, string scriptPath, bool elevate = false, string? arguments = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the action |
string | scriptPath | The full path of the script to run |
bool | elevate | A boolean indicating whether the file should run with administrator privileges |
string | arguments | Optional arguments to pass to your script, you are responsible for proper quoting etc. Arguments are available in PowerShell as |
Properties
Arguments
Gets optional arguments to pass to your script, you are responsible for proper quoting etc.
Arguments are available in PowerShell as $args[0], $args[1]
etc.
Declaration
public string? Arguments { get; }
Property Value
Type | Description |
---|---|
string |
Elevate
Gets a boolean indicating whether the file should run with administrator privileges
Declaration
public bool Elevate { get; }
Property Value
Type | Description |
---|---|
bool |
ScriptPath
Gets the inline full path of the script to run
Declaration
public string ScriptPath { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Execute(CancellationToken)
Called when the action must execute
Declaration
public override Task Execute(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |