Fixes install icinga security for admin shell

This commit is contained in:
Lord Hepipud 2022-01-29 00:40:41 +01:00
parent d8e87b9272
commit 6598eb0bb8
2 changed files with 6 additions and 0 deletions

View file

@ -37,6 +37,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#452](https://github.com/Icinga/icinga-powershell-framework/pull/452) Fixes unhandled `true` output on the console while running the installer * [#452](https://github.com/Icinga/icinga-powershell-framework/pull/452) Fixes unhandled `true` output on the console while running the installer
* [#454](https://github.com/Icinga/icinga-powershell-framework/pull/454) Fixes JEA catalog compiler and background daemon execution in JEA context * [#454](https://github.com/Icinga/icinga-powershell-framework/pull/454) Fixes JEA catalog compiler and background daemon execution in JEA context
* [#456](https://github.com/Icinga/icinga-powershell-framework/pull/456) Fixes JEA service error count not resetting itself after a certain amount of time without errors * [#456](https://github.com/Icinga/icinga-powershell-framework/pull/456) Fixes JEA service error count not resetting itself after a certain amount of time without errors
* [#458](https://github.com/Icinga/icinga-powershell-framework/pull/458) Fixes `Install-IcingaSecurity` which should only run in an administrative shell
### Enhancements ### Enhancements

View file

@ -12,6 +12,11 @@ function Install-IcingaSecurity()
return; return;
} }
if ((Test-AdministrativeShell) -eq $FALSE) {
Write-IcingaConsoleError -Message 'This command can only be executed from an administrative shell';
return;
}
# Max length for the user name # Max length for the user name
if ($IcingaUser.Length -gt 20) { if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser; Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;