mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Used Icinga-DSL for array-arg splitting
This commit is contained in:
parent
c525ba8ed2
commit
3d854da218
1 changed files with 10 additions and 1 deletions
|
|
@ -211,7 +211,16 @@ function Get-IcingaCheckCommandConfig()
|
|||
} elseif ($parameter.type.name -eq 'array') {
|
||||
$Basket.Command[$Data.Syntax.syntaxItem.Name].arguments.Add(
|
||||
[string]::Format('-{0}', $parameter.Name), @{
|
||||
'value' = [string]::Format('(Split-IcingaCheckCommandArgs {0})', $IcingaCustomVariable);
|
||||
'value' = @{
|
||||
'type' = 'Function';
|
||||
'body' = [string]::Format(
|
||||
'var arr = macro("{0}");{1}if (len(arr) == 0) {2}{1}return "$null";{1}{3}{1}return arr.join(",");',
|
||||
$IcingaCustomVariable,
|
||||
"`r`n",
|
||||
'{',
|
||||
'}'
|
||||
);
|
||||
}
|
||||
'order' = $Order;
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue