Start/Stop for AC services on Ally

This commit is contained in:
Serge
2024-01-19 20:39:50 +01:00
parent 8b26e9aeba
commit d8bf8ed463
4 changed files with 61 additions and 11 deletions

View File

@@ -94,11 +94,11 @@ namespace GHelper.Helpers
}
}
public static void StopDisableService(string serviceName)
public static void StopDisableService(string serviceName, string disable = "Disabled")
{
try
{
string script = $"Get-Service -Name \"{serviceName}\" | Stop-Service -Force -PassThru | Set-Service -StartupType Disabled";
string script = $"Get-Service -Name \"{serviceName}\" | Stop-Service -Force -PassThru | Set-Service -StartupType {disable}";
Logger.WriteLine(script);
RunCMD("powershell", script);
}