icinga-powershell-framework/lib/daemon/Unregister-IcingaBackgroundDaemon.psm1
2019-10-22 19:53:50 +02:00

17 lines
469 B
PowerShell

function Unregister-IcingaBackgroundDaemon()
{
param(
[string]$BackgroundDaemon,
[hashtable]$Arguments
);
if ([string]::IsNullOrEmpty($BackgroundDaemon)) {
throw 'Please specify a Cmdlet to remove from running as Background Daemon';
}
$Path = [string]::Format('BackgroundDaemon.EnabledDaemons.{0}', $BackgroundDaemon);
Remove-IcingaPowerShellConfig -Path $Path;
Write-Host 'Background daemon has been removed';
}