Implementation of script debugger component with RPC via SignalR
This commit is contained in:
parent
f242f66813
commit
17fa802c19
19 changed files with 516 additions and 62 deletions
17
LANCommander.SDK/PowerShell/PowerShellDebugContext.cs
Normal file
17
LANCommander.SDK/PowerShell/PowerShellDebugContext.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LANCommander.SDK.PowerShell;
|
||||
|
||||
public class PowerShellDebugContext(System.Management.Automation.PowerShell ps) : IScriptDebugContext
|
||||
{
|
||||
public Guid SessionId { get; set; } = Guid.NewGuid();
|
||||
|
||||
public async Task ExecuteAsync(string script)
|
||||
{
|
||||
ps.Commands.Clear();
|
||||
ps.AddScript(script);
|
||||
|
||||
await ps.InvokeAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue