From 8ed242ad5085c9e3e73191eee61dd3aa92bad46d Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Wed, 1 Jun 2022 16:54:13 +0200 Subject: [PATCH] Fixes package manifest reader on Win 2012 R2 --- doc/100-General/10-Changelog.md | 4 ++++ lib/core/repository/Read-IcingaPackageManifest.psm1 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/100-General/10-Changelog.md b/doc/100-General/10-Changelog.md index b473aa84..bbddc089 100644 --- a/doc/100-General/10-Changelog.md +++ b/doc/100-General/10-Changelog.md @@ -11,6 +11,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic [Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/23?closed=1) +### Bugfixes + +* [#529](https://github.com/Icinga/icinga-powershell-framework/pull/529) Fixes package manifest reader for Icinga for Windows components on Windows 2012 R2 and older + ### Enhancements * [#40](https://github.com/Icinga/icinga-powershell-framework/issues/40) Adds support to set service recovery for the Icinga Agent and Icinga for Windows service, to restart them in case of a crash or error diff --git a/lib/core/repository/Read-IcingaPackageManifest.psm1 b/lib/core/repository/Read-IcingaPackageManifest.psm1 index 78214c6f..e0b15446 100644 --- a/lib/core/repository/Read-IcingaPackageManifest.psm1 +++ b/lib/core/repository/Read-IcingaPackageManifest.psm1 @@ -34,7 +34,7 @@ function Read-IcingaPackageManifest() $FileName = $entry.Name.Replace('.psd1', ''); $FilePath = $entry.FullName.Replace($entry.Name, ''); $FileStream = $entry.Open(); - $FileReader = [System.IO.StreamReader]::new($FileStream); + $FileReader = New-Object 'System.IO.StreamReader'($FileStream); $PackageManifestContent = $FileReader.ReadToEnd(); $FileReader.Dispose();