Table of Contents

Class RunPowerShellAction

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents a plugin prerequisite action that runs a PowerShell script

Note: To run an inline script instead, use RunInlinePowerShellAction

public class RunPowerShellAction : PluginPrerequisiteAction
Inheritance
object
CorePropertyChanged
RunPowerShellAction
Inherited Members

Constructors

RunPowerShellAction(string, string, bool, string?)

Creates a new instance of a copy folder action

public RunPowerShellAction(string name, string scriptPath, bool elevate = false, string? arguments = null)

Parameters

name string

The name of the action

scriptPath string

The full path of the script to run

elevate bool

A boolean indicating whether the file should run with administrator privileges

arguments string

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.

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.

public string? Arguments { get; }

Property Value

string

Elevate

Gets a boolean indicating whether the file should run with administrator privileges

public bool Elevate { get; }

Property Value

bool

ScriptPath

Gets the inline full path of the script to run

public string ScriptPath { get; }

Property Value

string

Methods

Execute(CancellationToken)

Called when the action must execute

public override Task Execute(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task