@@ -466,7 +466,11 @@ function Write-IcingaPlainConfigurationFiles()
466
466
if ([string ]::IsNullOrEmpty($DataField.description )) {
467
467
break ;
468
468
}
469
- $IcingaConfig += [string ]::Format(' description = "{0}"{1}' , $DataField.description.Replace (" `r`n " , ' ' ), (New-IcingaNewLine ));
469
+ $Description = $DataField.description.Replace (" `r`n " , ' ' );
470
+ $Description = $Description.Replace (" `n " , ' ' );
471
+ $Description = $Description.Replace (" `r " , ' ' );
472
+ $Description = $Description.Replace (' "' , " '" );
473
+ $IcingaConfig += [string ]::Format(' description = "{0}"{1}' , $Description , (New-IcingaNewLine ));
470
474
break ;
471
475
}
472
476
}
@@ -481,6 +485,8 @@ function Write-IcingaPlainConfigurationFiles()
481
485
$IcingaConfig += New-IcingaNewLine ;
482
486
}
483
487
488
+ $IcingaConfig = $IcingaConfig.Substring (0 , $IcingaConfig.Length - 2 );
489
+
484
490
# Close all arguments content
485
491
$IcingaConfig += New-IcingaNewLine ;
486
492
$IcingaConfig += ' }'
@@ -494,6 +500,8 @@ function Write-IcingaPlainConfigurationFiles()
494
500
$Value = $CheckCommand.vars [$var ];
495
501
$IcingaConfig += [string ]::Format(' vars.{0} = {1}{2}' , $var , $Value , (New-IcingaNewLine ));
496
502
}
503
+ } else {
504
+ $IcingaConfig += New-IcingaNewLine ;
497
505
}
498
506
499
507
# Close the CheckCommand object
0 commit comments