mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
parent
c1710062ae
commit
c7c2ef8c22
1 changed files with 19 additions and 0 deletions
19
lib/core/framework/Uninstall-IcingaFrameworkService.psm1
Normal file
19
lib/core/framework/Uninstall-IcingaFrameworkService.psm1
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
function Uninstall-IcingaFrameworkService()
|
||||||
|
{
|
||||||
|
Stop-IcingaService 'icingapowershell';
|
||||||
|
Start-Sleep -Seconds 1;
|
||||||
|
|
||||||
|
$ServiceCreation = Start-IcingaProcess -Executable 'sc.exe' -Arguments 'delete icingapowershell';
|
||||||
|
|
||||||
|
switch ($ServiceCreation.ExitCode) {
|
||||||
|
0 {
|
||||||
|
Write-Host 'Icinga PowerShell Service was successfully removed';
|
||||||
|
}
|
||||||
|
1060 {
|
||||||
|
Write-Host 'The Icinga PowerShell Service is not installed';
|
||||||
|
}
|
||||||
|
Default {
|
||||||
|
throw ([string]::Format('Failed to install Icinga PowerShell Service: {0}{1}', $ServiceCreation.Message, $ServiceCreation.Error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue