diff --git a/lib/core/tools/Remove-IcingaDirectorSelfServiceKey.psm1 b/lib/core/tools/Remove-IcingaDirectorSelfServiceKey.psm1 new file mode 100644 index 0000000..6f30b34 --- /dev/null +++ b/lib/core/tools/Remove-IcingaDirectorSelfServiceKey.psm1 @@ -0,0 +1,14 @@ +function Remove-IcingaDirectorSelfServiceKey() +{ + $Path = 'IcingaDirector.SelfService.ApiKey'; + $Value = Get-IcingaPowerShellConfig $Path; + if ($null -ne $Value) { + Remove-IcingaPowerShellConfig 'IcingaDirector.SelfService.ApiKey'; + $Value = Get-IcingaPowerShellConfig $Path; + if ($null -eq $Value) { + Write-Host 'Icinga Director Self-Service Api key was successfully removed. Please dont forget to drop it within the Icinga Director as well'; + } + } else { + Write-Host 'There is no Self-Service Api key configured on this system'; + } +} diff --git a/lib/core/tools/Show-IcingaDirectorSelfServiceKey.psm1 b/lib/core/tools/Show-IcingaDirectorSelfServiceKey.psm1 new file mode 100644 index 0000000..806ad98 --- /dev/null +++ b/lib/core/tools/Show-IcingaDirectorSelfServiceKey.psm1 @@ -0,0 +1,11 @@ +function Show-IcingaDirecorSelfServiceKey() +{ + $Path = 'IcingaDirector.SelfService.ApiKey'; + $Value = Get-IcingaPowerShellConfig $Path; + + if ($null -ne $Value) { + Write-Host ([string]::Format('Self-Service Key: "{0}"', $Value)); + } else { + Write-Host 'There is no Self-Service Api key configured on this system'; + } +}