Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test-IcingaForWindowsMigration fails if more than one framework-version is found on the system #615

Closed
K0nne opened this issue Apr 18, 2023 · 2 comments · Fixed by #624
Closed
Assignees
Labels
Bug There is an issue present
Milestone

Comments

@K0nne
Copy link

K0nne commented Apr 18, 2023

I found a strange behaviour on a test system of mine. use-icinga failed with the following error:

PS C:\Windows\system32> use-icinga
Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Version".
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:3962 char:5
+     [Version]$CurrentFrameworkVersion = (Get-Module -ListAvailable -N ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : ConvertToFinalInvalidCastException

Expected Behavior

I think it is just a mistake of mine, but maybe this function should alert, if concurrent versions are found:

PS C:\Windows\system32> (Get-Module -ListAvailable -Name icinga-powershell-framework).Version;

Major  Minor  Build  Revision
-----  -----  -----  --------
1      10     1      -1
1      0      2      -1
1      2      0      -1

Possible Solution

Fail with a expressive error message.

@K0nne K0nne changed the title Test-IcingaForWindowsMigration fails if more than one version is found on the system Test-IcingaForWindowsMigration fails if more than one framework-version is found on the system Apr 18, 2023
@LordHepipud LordHepipud self-assigned this May 22, 2023
@LordHepipud LordHepipud added the Bug There is an issue present label May 22, 2023
@LordHepipud LordHepipud added this to the v1.11.0 milestone May 22, 2023
@LordHepipud
Copy link
Collaborator

Thanks for the issue. We will fix this with v1.11.0. We will apply the migration to the latest version and print a warning, if multiple frameworks are found.

@LordHepipud
Copy link
Collaborator

[Warning]: Found multiple installations of the module "icinga-powershell-framework". Please check the list below and cleanup your installation to ensure system integrity
 => Path "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework" with version "1.10.0"
 => Path "C:\Development\WindowsPowerShell\modules\icinga-powershell-framework" with version "1.11.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug There is an issue present
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants