mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-23 16:19:37 -05:00
parent
b978ee6574
commit
4b87a68b58
2 changed files with 25 additions and 0 deletions
14
lib/core/tools/Remove-IcingaDirectorSelfServiceKey.psm1
Normal file
14
lib/core/tools/Remove-IcingaDirectorSelfServiceKey.psm1
Normal file
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
11
lib/core/tools/Show-IcingaDirectorSelfServiceKey.psm1
Normal file
11
lib/core/tools/Show-IcingaDirectorSelfServiceKey.psm1
Normal file
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue