Class RunPowerShellAction
Represents a plugin prerequisite action that runs a PowerShell script
Note: To run an inline script instead, use RunInlinePowerShellAction
public class RunPowerShellAction : PluginPrerequisiteAction
- Inheritance
-
objectCorePropertyChangedRunPowerShellAction
- 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
namestringThe name of the action
scriptPathstringThe full path of the script to run
elevateboolA boolean indicating whether the file should run with administrator privileges
argumentsstringOptional 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
Elevate
Gets a boolean indicating whether the file should run with administrator privileges
public bool Elevate { get; }
Property Value
ScriptPath
Gets the inline full path of the script to run
public string ScriptPath { get; }
Property Value
Methods
Execute(CancellationToken)
Called when the action must execute
public override Task Execute(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken