Skip to content

Commit fc737d9

Browse files
committed
Add ImageType property to Amazon Corretto output
Introduces an ImageType field to the returned object in Get-AmazonCorretto.ps1, distinguishing between JRE, JDK, or Unknown based on the download URL. This provides clearer metadata for consumers of the function.
1 parent 7a3c24a commit fc737d9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Evergreen/Shared/Get-AmazonCorretto.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,22 @@ function Get-AmazonCorretto {
2323

2424
# Construct the output; Return the custom object to the pipeline
2525
if ($null -ne $Response) {
26+
27+
$ImageType = if ($Url -match "jre") {
28+
"JRE"
29+
}
30+
elseif ($Url -match "jdk") {
31+
"JDK"
32+
}
33+
else {
34+
"Unknown"
35+
}
36+
2637
$PSObject = [PSCustomObject] @{
2738
Version = [RegEx]::Match($Response.ResponseUri.LocalPath, $res.Get.Download.MatchVersion).Captures.Groups[1].Value
2839
Md5 = (Invoke-EvergreenWebRequest -Uri $ChecksumUrl -Raw -ReturnObject "Content")
2940
Architecture = Get-Architecture -String $Response.ResponseUri.AbsoluteUri
41+
ImageType = $ImageType
3042
Type = Get-FileType -File $Response.ResponseUri.AbsoluteUri
3143
URI = $Response.ResponseUri.AbsoluteUri
3244
}

0 commit comments

Comments
 (0)