forked from canneverbe/Ketarin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowerShellScript.cs
More file actions
26 lines (22 loc) · 791 Bytes
/
Copy pathPowerShellScript.cs
File metadata and controls
26 lines (22 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Text;
using Ketarin.Forms;
namespace Ketarin
{
internal class PowerShellScript
{
private readonly string scriptText;
public PowerShellScript(string scriptText)
{
this.scriptText = scriptText;
}
public string LastOutput { get; private set; } = string.Empty;
internal void Execute(ApplicationJob application, ApplicationJobError? errorInfo = null)
{
// Use our new ScriptExecutor instead of PowerShell
Database.ScriptExecutor executor = new Database.ScriptExecutor(this.scriptText, Database.ScriptType.PowerShell);
executor.Execute(application, errorInfo);
this.LastOutput = executor.LastOutput;
}
}
}