The required module 'icinga-powershell-framework' with version '1.10.0' is not loaded

Hello,
starting from today IcingaForWindows PowerShell plugins do not work anymore when getting most recent packages from packages.icinga.com - error message in output:

[Error]: Component “plugins” has been installed with version “1.10.0”, but while importing the component an exception was thrown: The required module ‘icinga-powershell-framework’ with version ‘1.10.0’ is not loaded. Load the module or remove the module from ‘RequiredModules’ in the file ‘C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins\icinga-powershell-plugins.psd1’.

I have checked icinga-powershell-plugins.psd1 & found that it containts the line

RequiredModules = @(@{ModuleName = 'icinga-powershell-framework'; ModuleVersion = '1.10.0' })

But my freshly installed PS-module is:

PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.9.2      icinga-powershell-framework         {Add-IcingaAddTypeLib, Add-IcingaArrayListItem, A..

So I changed to “1.9.2” instead of “1.10.0”, restarted service & now it is working.

Are you already aware of this bug ?

Regards.

Hi,

I’m having the same issue while deploying on a new machine.


On our webserver (custom repository) I saw the initial script downloading the 1.9.2 (old/previous) framework version (/icingastable/framework/icinga-powershell-framework-1.9.2.zip).

But the new version is contained in the repository json (/icingastable/ifw.repo.json).
grep "1.10.0" /var/www/icingarepo/icingastable/ifw.repo.json

                                       "Location":  "framework\\icinga-powershell-framework-1.10.0.zip",
                                       "Version":  "1.10.0",
                                     "Location":  "plugins\\icinga-powershell-plugins-1.10.0.zip",
                                     "Version":  "1.10.0",

After a short research i found the root cause, the initial PowerShell Script “IcingaForWindows.ps1” does a sort operation over a data object from type string.
That results in a wrong Version Order. Version “1.10.0” is before 1.5.0 (at the bottom) and not at the top.

for me changing thouse two lines solved the issue.

#$KickstartPackage = $RepoData.Packages.Kickstart | Sort-Object Version -Descending | Select-Object -First 1;
#$FrameworkPackage = $RepoData.Packages.Framework | Sort-Object Version -Descending | Select-Object -First 1;
$KickstartPackage = $RepoData.Packages.Kickstart | Sort-Object -Property {[version[]]$_.Version} -Descending | Select-Object -First 1;
$FrameworkPackage = $RepoData.Packages.Framework | Sort-Object -Property {[version[]]$_.Version} -Descending | Select-Object -First 1;

(afterword uploaded to our internal repository location)

There is a similar issue on github.
https://github.com/Icinga/icinga-powershell-framework/issues/576

Best Regards,
Marcel