Add remote desktop start/stop commands and process with server support

This commit is contained in:
Stone_Red
2026-06-17 00:02:33 +02:00
parent 67852bb344
commit 8d1cd6d369
5 changed files with 118 additions and 2 deletions
@@ -0,0 +1,26 @@
using RemSox.Processes;
using RemSox.Processing;
namespace RemSox.UI.CLI.Commands;
public class StopRemoteDesktopCommand : ICommand
{
public string Name => "rdp-stop";
public string Description => "Stops the remote desktop server";
public async Task ExecuteAsync(string? arguments, Action<string> printLine)
{
if (!ProcessManager.IsProcessRunning<RemoteDesktopProcess>())
{
printLine("Remote desktop server is not running.");
return;
}
foreach (RemoteDesktopProcess process in ProcessManager.GetProcessesOfType<RemoteDesktopProcess>())
{
await ProcessManager.StopProcessAndWaitAsync(process.Id);
}
printLine("Remote desktop server stopped.");
}
}