-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Current Behavior
At the moment the basket defines -C (in contrast to -ExecutionPolicy, -NoLogo and -NoProfile) on every single check command, like this:
try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $$($$_.Exception.Message)Components:
rn$$( Get-Module -ListAvailable 'icinga-powershell-*' )
rn'Module-Path:'
rn$$($$Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command 'Invoke-IcingaCheckUsers'
However, those strings differ only minimal:
Possible Solution
I suggest to make their only difference -the command name- a custom var set on every command and to centralise -C (next to -ExecutionPolicy etc.?), using the custom var. I.e.:
try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $$($$_.Exception.Message)Components:
rn$$( Get-Module -ListAvailable 'icinga-powershell-*' )
rn'Module-Path:'
rn$$($$Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command '$YourPreferedNameForCommandName$'