-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
37 lines (34 loc) · 1.14 KB
/
Program.cs
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
27
28
29
30
31
32
33
34
35
36
37
namespace RunPowerShellCSharp;
internal static class Program {
/// <summary>
/// Small example showing only single PowerShell method made by Santi
/// </summary>
/// <returns></returns>
private static async Task ExampleSmall() {
var parameters = new Dictionary<string, object>();
var executor = new PowerShellExecuteSmall();
await executor.ExecuteScriptAsync(parameters);
}
/// <summary>
/// A bit more advanced example showing multiple PowerShell methods as proposed by Santi
/// </summary>
/// <returns></returns>
private static async Task ExampleBig() {
var parameters = new Dictionary<string, object> {
{ "Number", 1 }
};
var executor = new PowerShellExecuteBig();
await executor.ExecuteScriptAsync(parameters);
}
/// <summary>
/// Main method to run the examples
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
static async Task Main(string[] args) {
await ExampleSmall();
Console.WriteLine("-------");
await ExampleBig();
Console.WriteLine("-------");
}
}