Icinga Powershell framework exiting Script Halted

Hi,

as described in the titel in my PS Script i get to a point where a director error occurs and the IcingaAgentwizard wants me to reenter my self service key. At this point my script should just write out that there was a problem. But i cant exit this sequence in my script. The only thing that works is to press ctr + c manually.
Is there a way i can disable this “asking for input”?

$ici = icinga "Enable-IcingaUntrustedCertificateValidation; Enable-IcingaFrameworkDebugMode; try {Start-IcingaAgentInstallWizard -SelfServiceAPIKey $apitoken -EmptyCA 0 -UseDirectorSelfService 1 -DirectorUrl $url -OverrideDirectorVars 0 -ConvertEndpointIPConfig 1 -Ticket ''  -EmptyTicket 1 -InstallFrameworkPlugins 0 -InstallFrameworkService 0 -CAEndpoint $ca  -RunInstaller -WriteStackTrace;}catch[ProcessStreamReader_CliXmlError]{ 'eror occured' }Finally{ exit;}"

This is the line in my script. Using icinga powershell framework 1.5.1
The error:

Failed to register host within Icinga Director. Full error: "ScriptHalted". Please re-enter your SelfService API Key. If this prompt continues ensure you are using an Agent template or drop your host key at "Hosts -> myhost.net -> Agent" (Defaults: "my agent key"):

hope you can help me soon

Felix

1 Like