Skip to content

Commit 4b87a68

Browse files
committed
Add Cmdlets to Show / Remove SelfService Api Key
Fixes #35
1 parent b978ee6 commit 4b87a68

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function Remove-IcingaDirectorSelfServiceKey()
2+
{
3+
$Path = 'IcingaDirector.SelfService.ApiKey';
4+
$Value = Get-IcingaPowerShellConfig $Path;
5+
if ($null -ne $Value) {
6+
Remove-IcingaPowerShellConfig 'IcingaDirector.SelfService.ApiKey';
7+
$Value = Get-IcingaPowerShellConfig $Path;
8+
if ($null -eq $Value) {
9+
Write-Host 'Icinga Director Self-Service Api key was successfully removed. Please dont forget to drop it within the Icinga Director as well';
10+
}
11+
} else {
12+
Write-Host 'There is no Self-Service Api key configured on this system';
13+
}
14+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function Show-IcingaDirecorSelfServiceKey()
2+
{
3+
$Path = 'IcingaDirector.SelfService.ApiKey';
4+
$Value = Get-IcingaPowerShellConfig $Path;
5+
6+
if ($null -ne $Value) {
7+
Write-Host ([string]::Format('Self-Service Key: "{0}"', $Value));
8+
} else {
9+
Write-Host 'There is no Self-Service Api key configured on this system';
10+
}
11+
}

0 commit comments

Comments
 (0)