mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Ensured custom_vars Variable Part is always identical
This commit is contained in:
parent
5e6f4e5c7f
commit
289b1a1ed5
1 changed files with 7 additions and 7 deletions
|
|
@ -162,7 +162,7 @@ function Get-IcingaCheckCommandConfig()
|
||||||
[string]$Order = 99
|
[string]$Order = 99
|
||||||
}
|
}
|
||||||
|
|
||||||
$IcingaCustomVariable = [string]::Format('$PowerShell_{0}_{1}$', $parameter.type.name, $parameter.Name);
|
$IcingaCustomVariable = [string]::Format('$PowerShell_{0}_{1}$', (Get-Culture).TextInfo.ToTitleCase($parameter.type.name), $parameter.Name);
|
||||||
|
|
||||||
# Todo: Should we improve this? Actually the handling would be identical, we just need to assign
|
# Todo: Should we improve this? Actually the handling would be identical, we just need to assign
|
||||||
# the proper field for this
|
# the proper field for this
|
||||||
|
|
@ -222,7 +222,7 @@ function Get-IcingaCheckCommandConfig()
|
||||||
$Required = 'n';
|
$Required = 'n';
|
||||||
}
|
}
|
||||||
|
|
||||||
$IcingaCustomVariable = [string]::Format('PowerShell_{0}_{1}', $parameter.type.name, $parameter.Name);
|
$IcingaCustomVariable = [string]::Format('PowerShell_{0}_{1}', (Get-Culture).TextInfo.ToTitleCase($parameter.type.name), $parameter.Name);
|
||||||
|
|
||||||
# Todo: Should we improve this? Actually the handling would be identical, we just need to assign
|
# Todo: Should we improve this? Actually the handling would be identical, we just need to assign
|
||||||
# the proper field for this
|
# the proper field for this
|
||||||
|
|
@ -263,7 +263,7 @@ function Get-IcingaCheckCommandConfig()
|
||||||
if($Basket.Datafield.ContainsKey('0') -eq $FALSE){
|
if($Basket.Datafield.ContainsKey('0') -eq $FALSE){
|
||||||
$Basket.Datafield.Add(
|
$Basket.Datafield.Add(
|
||||||
'0', @{
|
'0', @{
|
||||||
'varname' = 'PowerShell_switch_NoPerfData';
|
'varname' = 'PowerShell_Switch_NoPerfData';
|
||||||
'caption' = 'Ignore Performance Data';
|
'caption' = 'Ignore Performance Data';
|
||||||
'description' = 'Specifies if the plugin will return performance data output or not';
|
'description' = 'Specifies if the plugin will return performance data output or not';
|
||||||
'datatype' = 'Icinga\Module\Director\DataType\DataTypeBoolean';
|
'datatype' = 'Icinga\Module\Director\DataType\DataTypeBoolean';
|
||||||
|
|
@ -372,12 +372,12 @@ function Get-IcingaCheckCommandConfig()
|
||||||
if ($Basket.Command[$Data.Name].arguments.ContainsKey('-NoPerfData') -eq $FALSE) {
|
if ($Basket.Command[$Data.Name].arguments.ContainsKey('-NoPerfData') -eq $FALSE) {
|
||||||
$Basket.Command[$Data.Name].arguments.Add(
|
$Basket.Command[$Data.Name].arguments.Add(
|
||||||
'-NoPerfData', @{
|
'-NoPerfData', @{
|
||||||
'set_if' = '$PowerShell_switch_NoPerfData$';
|
'set_if' = '$PowerShell_Switch_NoPerfData$';
|
||||||
'set_if_format' = 'string';
|
'set_if_format' = 'string';
|
||||||
'order' = '99';
|
'order' = '99';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$Basket.Command[$Data.Name].vars.Add('PowerShell_switch_NoPerfData', $FALSE);
|
$Basket.Command[$Data.Name].vars.Add('PowerShell_Switch_NoPerfData', $FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -386,8 +386,8 @@ function Get-IcingaCheckCommandConfig()
|
||||||
|
|
||||||
$Data = (Get-Help $check)
|
$Data = (Get-Help $check)
|
||||||
|
|
||||||
foreach ($parameter in $Data.parameters.parameter){
|
foreach ($parameter in $Data.parameters.parameter) {
|
||||||
$IcingaCustomVariable = [string]::Format('PowerShell_{0}_{1}', $parameter.type.name, $parameter.Name);
|
$IcingaCustomVariable = [string]::Format('PowerShell_{0}_{1}', (Get-Culture).TextInfo.ToTitleCase($parameter.type.name), $parameter.Name);
|
||||||
|
|
||||||
# Todo: Should we improve this? Actually the handling would be identical, we just need to assign
|
# Todo: Should we improve this? Actually the handling would be identical, we just need to assign
|
||||||
# the proper field for this
|
# the proper field for this
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue