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

[Bug]: AmazonCorretto string versions too long to cast to System.Version #502

Closed
2 tasks done
bailey-mcquary opened this issue Jun 20, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@bailey-mcquary
Copy link

What happened?

Get-EvergreenLibraryApp -Inventory $library -Name AmazonCorretto errors out due to the Corretto version numbers being too long to cast to a [Version] type.

Unless there's a way to coerce System.Version to work with longer version numbers, an easy fix would be just leaving the JDK version off of the version number since that data is already present in the JDK Version property.

Version

2305.792

What PowerShell edition/s are you running Evergreen on?

Windows PowerShell

Which operating system/s are you running Evergreen on?

Windows 10

Have you reviewed the documentation?

Verbose output

VERBOSE: Input object has the required Inventory property.
VERBOSE: Filtering library inventory for 'AmazonCorretto'
Sort-Object : Cannot convert value "11.0.19.7.1" to type "System.Version". Error: "Version string portion was too short or too long."
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2305.792\Public\Get-EvergreenLibraryApp.ps1:42 char:64
+ ... .Versions | Sort-Object -Property @{ Expression = { [System.Version]$ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (@{Version=11.0....chitecture=x64}:PSObject) [Sort-Object], RuntimeException
    + FullyQualifiedErrorId : ExpressionEvaluation,Microsoft.PowerShell.Commands.SortObjectCommand

Sort-Object : Cannot convert value "11.0.19.7.1" to type "System.Version". Error: "Version string portion was too short or too long."
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2305.792\Public\Get-EvergreenLibraryApp.ps1:42 char:64
+ ... .Versions | Sort-Object -Property @{ Expression = { [System.Version]$ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (@{Version=11.0....chitecture=x86}:PSObject) [Sort-Object], RuntimeException
    + FullyQualifiedErrorId : ExpressionEvaluation,Microsoft.PowerShell.Commands.SortObjectCommand

Sort-Object : Cannot convert value "15.0.2.7.1" to type "System.Version". Error: "Version string portion was too short or too long."
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2305.792\Public\Get-EvergreenLibraryApp.ps1:42 char:64
+ ... .Versions | Sort-Object -Property @{ Expression = { [System.Version]$ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (@{Version=15.0....chitecture=x64}:PSObject) [Sort-Object], RuntimeException
    + FullyQualifiedErrorId : ExpressionEvaluation,Microsoft.PowerShell.Commands.SortObjectCommand

Sort-Object : Cannot convert value "16.0.2.7.1" to type "System.Version". Error: "Version string portion was too short or too long."
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2305.792\Public\Get-EvergreenLibraryApp.ps1:42 char:64
+ ... .Versions | Sort-Object -Property @{ Expression = { [System.Version]$ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (@{Version=16.0....chitecture=x64}:PSObject) [Sort-Object], RuntimeException
    + FullyQualifiedErrorId : ExpressionEvaluation,Microsoft.PowerShell.Commands.SortObjectCommand

Sort-Object : Cannot convert value "17.0.7.7.1" to type "System.Version". Error: "Version string portion was too short or too long."
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2305.792\Public\Get-EvergreenLibraryApp.ps1:42 char:64
+ ... .Versions | Sort-Object -Property @{ Expression = { [System.Version]$ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (@{Version=17.0....chitecture=x64}:PSObject) [Sort-Object], RuntimeException
    + FullyQualifiedErrorId : ExpressionEvaluation,Microsoft.PowerShell.Commands.SortObjectCommand
@bailey-mcquary bailey-mcquary added the bug Something isn't working label Jun 20, 2023
@aaronparker
Copy link
Owner

aaronparker commented Jun 26, 2023

What's the value of Filter you're using for AmazonCorretto in your EvergreenLibrary.json?

aaronparker added a commit that referenced this issue Jun 26, 2023
@bailey-mcquary
Copy link
Author

"$_.Type -eq "Msi""

@aaronparker
Copy link
Owner

So you're downloading all major releases and architectures to the library?

I've made a change in the development branch which would be worth testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants