From 7039cec560908f59ef80a07d415c7f3cf5e2a262 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Fri, 4 Jun 2021 11:19:51 +0200 Subject: [PATCH] Fixes string build creation on old windows systems --- doc/31-Changelog.md | 11 +++++++++++ lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 | 2 +- lib/icinga/plugin/New-IcingaCheckPackage.psm1 | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/31-Changelog.md b/doc/31-Changelog.md index 4f4896e..8a54a47 100644 --- a/doc/31-Changelog.md +++ b/doc/31-Changelog.md @@ -7,6 +7,17 @@ documentation before upgrading to a new release. Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed). +## 1.6.0 (pending) + +[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/15?closed=1) + +## 1.5.1 (pending) + +[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/17?closed=1) +### Bugfixes + +* [#282](https://github.com/Icinga/icinga-powershell-framework/issues/282) Fixes issue on `System.Text.StringBuilder` which fails to initialize properly on some older Windows systems + ## 1.5.0 (2021-06-02) [Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/13?closed=1) diff --git a/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 b/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 index 757b955..c169675 100644 --- a/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 +++ b/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 @@ -397,7 +397,7 @@ function Compare-IcingaPluginThresholds() } } - $PluginOutputMessage = [System.Text.StringBuilder]::New(); + $PluginOutputMessage = New-Object -TypeName 'System.Text.StringBuilder'; [string]$PluginCurrentValue = [string]::Format( '{0}', diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index c63b6dc..6fdc64a 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -98,7 +98,7 @@ function New-IcingaCheckPackage() $UnknownChecks = ''; $CriticalChecks = ''; $WarningChecks = ''; - $CheckSummary = [System.Text.StringBuilder]::New(); + $CheckSummary = New-Object -TypeName 'System.Text.StringBuilder'; [bool]$HasContent = $FALSE; # Only apply this to the top parent package