$ErrorMessage='Failed to fetch certificate ticket for this host over Self-Service API. Please check that your Icinga Director Url "{1}" is valid and the provided API key "{0}" belongs to a Icinga host object.';
break;
};
500{
$ErrorMessage='Failed to fetch certificate ticket for this host over Self-Service API. Please check that your Icinga CA is running, you have configured a Ticketsalt and that your Icinga Director has enough permissions to communicate with the Icinga 2 API for generating tickets.';
break;
};
901{
$ErrorMessage='Failed to fetch certificate ticket for this host over Self-Service API because of SSL/TLS error. Please ensure the certificate is valid and use "Enable-IcingaUntrustedCertificateValidation" for self-signed certificates or install the certificate on this machine.';
break;
}
Default{
$ErrorMessage=([string]::Format('Failed to fetch certificate ticket from Icinga Director because of unhandled exception: {0}',$response.StatusCode));