mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
20 lines
814 B
PowerShell
20 lines
814 B
PowerShell
|
|
function Install-IcingaSecurity()
|
||
|
|
{
|
||
|
|
param (
|
||
|
|
[string]$IcingaUser = 'icinga',
|
||
|
|
[switch]$RebuildFramework = $FALSE,
|
||
|
|
[switch]$AllowScriptBlocks = $FALSE,
|
||
|
|
[switch]$ConstrainedLanguage = $FALSE
|
||
|
|
);
|
||
|
|
|
||
|
|
if ($PSVersionTable.PSVersion -lt (New-IcingaVersionObject -Version 5, 0)) {
|
||
|
|
Write-IcingaConsoleError 'You cannot use JEA profiles on your system, as your installed PowerShell version "{0}" is lower than minimum required version "5.0"' -Objects $PSVersionTable.PSVersion;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
Install-IcingaServiceUser -IcingaUser $IcingaUser;
|
||
|
|
Install-IcingaJEAProfile -IcingaUser $IcingaUser -RebuildFramework:$RebuildFramework -AllowScriptBlocks:$AllowScriptBlocks -ConstrainedLanguage:$ConstrainedLanguage;
|
||
|
|
|
||
|
|
Restart-IcingaWindowsService;
|
||
|
|
}
|