From 88ae1e13095e0abe7c5a0f87f3d4d77e7a6d6803 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sat, 7 Nov 2026 21:58:42 +1100 Subject: [PATCH 1/7] Convert resolved link dates to DateTime Normalize the Date property returned by Resolve-MicrosoftFwLink so it uses the module's date conversion helper. --- Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 index 718298c0..6f8182c0 100644 --- a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 +++ b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 @@ -68,7 +68,7 @@ function Resolve-MicrosoftFwLink { # Output a version object [PSCustomObject]@{ Version = $Version - Date = $Date + Date = ConvertTo-DateTime -DateTime $Date Size = $Size Language = "Unknown" Architecture = Get-Architecture -String $ResolvedUrl.ResponseUri.AbsoluteUri From 8d302a43f21e34ba6f0a40beb96e1c959ca82591 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sat, 7 Nov 2026 21:59:01 +1100 Subject: [PATCH 2/7] Reorder SourceForge release properties Place Size and Md5 before Architecture and Type in the release output object. --- Evergreen/Shared/Get-SourceForgeRepoRelease.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Evergreen/Shared/Get-SourceForgeRepoRelease.ps1 b/Evergreen/Shared/Get-SourceForgeRepoRelease.ps1 index ffa8422e..e173e0ec 100644 --- a/Evergreen/Shared/Get-SourceForgeRepoRelease.ps1 +++ b/Evergreen/Shared/Get-SourceForgeRepoRelease.ps1 @@ -120,10 +120,10 @@ # Create the output object $PSObject = [PSCustomObject] @{ Version = $Version - Architecture = Get-Architecture -String $FileName - Type = [System.IO.Path]::GetExtension($FileName).TrimStart(".") Size = $item.content.filesize Md5 = $item.content.hash.'#text' + Architecture = Get-Architecture -String $FileName + Type = [System.IO.Path]::GetExtension($FileName).TrimStart(".") FileName = $FileName URI = $Url } From 2e961a48ef2bff29f3de5cecb57b534aaaad6cad Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sat, 7 Nov 2026 22:11:00 +1100 Subject: [PATCH 3/7] Update Get-InstallerType.ps1 --- Evergreen/Private/Get-InstallerType.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Evergreen/Private/Get-InstallerType.ps1 b/Evergreen/Private/Get-InstallerType.ps1 index 626b6939..994524f1 100644 --- a/Evergreen/Private/Get-InstallerType.ps1 +++ b/Evergreen/Private/Get-InstallerType.ps1 @@ -23,6 +23,7 @@ function Get-InstallerType { classic = "Classic" debug = "Debug" grouppolicy = "GroupPolicy" + hybridCRT = "HybridCRT" legacy = "Legacy" light = "Light" minimalist = "Minimal" From 578265fd846334b37f1a1e0f1fab9ab3b3868a6b Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Wed, 18 Nov 2026 10:08:52 +1100 Subject: [PATCH 4/7] Add conditional property update helper Add Set-ObjectProperty to update properties in place when their values match, while returning objects unchanged on a mismatch. Support -WhatIf and -Confirm, and cover dry runs and selective pipeline updates with Pester tests. --- Evergreen/Private/Set-ObjectProperty.ps1 | 44 ++++++++++++++++++++++ tests/Private/Set-ObjectProperty.Tests.ps1 | 27 +++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 Evergreen/Private/Set-ObjectProperty.ps1 create mode 100644 tests/Private/Set-ObjectProperty.Tests.ps1 diff --git a/Evergreen/Private/Set-ObjectProperty.ps1 b/Evergreen/Private/Set-ObjectProperty.ps1 new file mode 100644 index 00000000..86a10175 --- /dev/null +++ b/Evergreen/Private/Set-ObjectProperty.ps1 @@ -0,0 +1,44 @@ +<# + .SYNOPSIS + Replaces an object's property value when it matches the expected value. + .DESCRIPTION + Updates the object in place and outputs it whether or not a change is made. + Use -WhatIf to preview matching updates or -Confirm to approve each update. +#> +function Set-ObjectProperty { + [CmdletBinding(SupportsShouldProcess = $true)] + [OutputType([pscustomobject])] + param( + [Parameter(Mandatory, ValueFromPipeline)] + [pscustomobject]$InputObject, + + [Parameter(Mandatory)] + [string]$PropertyName, + + [Parameter(Mandatory)] + [AllowNull()] + [AllowEmptyString()] + [AllowEmptyCollection()] + [object]$CurrentValue, + + [Parameter(Mandatory)] + [AllowNull()] + [AllowEmptyString()] + [AllowEmptyCollection()] + [object]$Value + ) + + process { + $property = $InputObject.PSObject.Properties[$PropertyName] + if ($null -eq $property) { + throw "Property '$PropertyName' does not exist on the input object." + } + + if ([System.Management.Automation.LanguagePrimitives]::Equals($property.Value, $CurrentValue, $true) -and + $PSCmdlet.ShouldProcess($property.Name, "Set object property")) { + $property.Value = $Value + } + + $InputObject + } +} diff --git a/tests/Private/Set-ObjectProperty.Tests.ps1 b/tests/Private/Set-ObjectProperty.Tests.ps1 new file mode 100644 index 00000000..3c346cec --- /dev/null +++ b/tests/Private/Set-ObjectProperty.Tests.ps1 @@ -0,0 +1,27 @@ +Describe -Name "Set-ObjectProperty" { + It "Outputs the original object without updating a matching property under WhatIf" { + InModuleScope -ModuleName "Evergreen" { + $Object = [PSCustomObject]@{ Status = "Pending" } + + $Result = $Object | Set-ObjectProperty -PropertyName "Status" -CurrentValue "Pending" -Value "Complete" -WhatIf + + [object]::ReferenceEquals($Result, $Object) | Should -BeTrue + $Object.Status | Should -BeExactly "Pending" + } + } + + It "Updates only matching properties when confirmation is suppressed" { + InModuleScope -ModuleName "Evergreen" { + $Objects = @( + [PSCustomObject]@{ Status = "Pending" } + [PSCustomObject]@{ Status = "Skipped" } + ) + + $Result = @($Objects | Set-ObjectProperty -PropertyName "Status" -CurrentValue "Pending" -Value "Complete" -Confirm:$false) + + $Result.Count | Should -Be 2 + $Objects[0].Status | Should -BeExactly "Complete" + $Objects[1].Status | Should -BeExactly "Skipped" + } + } +} From 92ddc0c669843128e6af3a2c35ffc26c5cff943f Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Wed, 18 Nov 2026 10:25:48 +1100 Subject: [PATCH 5/7] Return FwLink dates without conversion Use the resolved date directly instead of passing it through ConvertTo-DateTime. Suppress PSUseCompatibleCommands in the resolver tests, which run on PowerShell 7.4 or later. --- Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 | 2 +- tests/Shared/Resolve-MicrosoftFwLink.Tests.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 index 6f8182c0..718298c0 100644 --- a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 +++ b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 @@ -68,7 +68,7 @@ function Resolve-MicrosoftFwLink { # Output a version object [PSCustomObject]@{ Version = $Version - Date = ConvertTo-DateTime -DateTime $Date + Date = $Date Size = $Size Language = "Unknown" Architecture = Get-Architecture -String $ResolvedUrl.ResponseUri.AbsoluteUri diff --git a/tests/Shared/Resolve-MicrosoftFwLink.Tests.ps1 b/tests/Shared/Resolve-MicrosoftFwLink.Tests.ps1 index 88a558e1..2e6676fe 100644 --- a/tests/Shared/Resolve-MicrosoftFwLink.Tests.ps1 +++ b/tests/Shared/Resolve-MicrosoftFwLink.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { From 785bf085a81dd4da2e0572e922d6bd617348d000 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Wed, 18 Nov 2026 10:26:35 +1100 Subject: [PATCH 6/7] Suppress compatibility warnings in shared tests Mark shared tests as targeting PowerShell 7.4+ to silence `PSUseCompatibleCommands` warnings. Add the missing test-file metadata to the GitHub release tests. --- tests/Shared/Get-AdoptiumTemurin.Tests.ps1 | 1 + tests/Shared/Get-AmazonCorretto.Tests.ps1 | 1 + tests/Shared/Get-AzulZulu.Tests.ps1 | 1 + tests/Shared/Get-BellSoftLibericaJDK.Tests.ps1 | 1 + tests/Shared/Get-ElgatoApp.Tests.ps1 | 1 + tests/Shared/Get-GitHubRepoRelease.Tests.ps1 | 5 +++++ tests/Shared/Get-GitLabRepoRelease.Tests.ps1 | 1 + tests/Shared/Get-HashicorpApp.Tests.ps1 | 1 + tests/Shared/Get-JetBrainsApp.Tests.ps1 | 1 + tests/Shared/Get-OperaApp.Tests.ps1 | 1 + tests/Shared/Get-OracleJava.Tests.ps1 | 1 + tests/Shared/Get-SourceForgeRepoRelease.Tests.ps1 | 1 + 12 files changed, 16 insertions(+) diff --git a/tests/Shared/Get-AdoptiumTemurin.Tests.ps1 b/tests/Shared/Get-AdoptiumTemurin.Tests.ps1 index 11bec7de..9a59bde8 100644 --- a/tests/Shared/Get-AdoptiumTemurin.Tests.ps1 +++ b/tests/Shared/Get-AdoptiumTemurin.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-AmazonCorretto.Tests.ps1 b/tests/Shared/Get-AmazonCorretto.Tests.ps1 index 4e149eca..31426824 100644 --- a/tests/Shared/Get-AmazonCorretto.Tests.ps1 +++ b/tests/Shared/Get-AmazonCorretto.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-AzulZulu.Tests.ps1 b/tests/Shared/Get-AzulZulu.Tests.ps1 index 2adf2045..d1ba644f 100644 --- a/tests/Shared/Get-AzulZulu.Tests.ps1 +++ b/tests/Shared/Get-AzulZulu.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-BellSoftLibericaJDK.Tests.ps1 b/tests/Shared/Get-BellSoftLibericaJDK.Tests.ps1 index 27f1c38e..7e7d0e80 100644 --- a/tests/Shared/Get-BellSoftLibericaJDK.Tests.ps1 +++ b/tests/Shared/Get-BellSoftLibericaJDK.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-ElgatoApp.Tests.ps1 b/tests/Shared/Get-ElgatoApp.Tests.ps1 index 0d10ea64..3bda7027 100644 --- a/tests/Shared/Get-ElgatoApp.Tests.ps1 +++ b/tests/Shared/Get-ElgatoApp.Tests.ps1 @@ -3,6 +3,7 @@ Shared Pester function tests. #> [OutputType()] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-GitHubRepoRelease.Tests.ps1 b/tests/Shared/Get-GitHubRepoRelease.Tests.ps1 index 60dc05a9..808f6f72 100644 --- a/tests/Shared/Get-GitHubRepoRelease.Tests.ps1 +++ b/tests/Shared/Get-GitHubRepoRelease.Tests.ps1 @@ -1,3 +1,8 @@ +[OutputType()] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] +param () + InModuleScope -ModuleName "Evergreen" { Describe "Repository helper " -ForEach @( @{ diff --git a/tests/Shared/Get-GitLabRepoRelease.Tests.ps1 b/tests/Shared/Get-GitLabRepoRelease.Tests.ps1 index 05810bba..8d33dd76 100644 --- a/tests/Shared/Get-GitLabRepoRelease.Tests.ps1 +++ b/tests/Shared/Get-GitLabRepoRelease.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () BeforeDiscovery { diff --git a/tests/Shared/Get-HashicorpApp.Tests.ps1 b/tests/Shared/Get-HashicorpApp.Tests.ps1 index 0656604f..4dc673b8 100644 --- a/tests/Shared/Get-HashicorpApp.Tests.ps1 +++ b/tests/Shared/Get-HashicorpApp.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-JetBrainsApp.Tests.ps1 b/tests/Shared/Get-JetBrainsApp.Tests.ps1 index 5de3dd3a..7ee7dffb 100644 --- a/tests/Shared/Get-JetBrainsApp.Tests.ps1 +++ b/tests/Shared/Get-JetBrainsApp.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-OperaApp.Tests.ps1 b/tests/Shared/Get-OperaApp.Tests.ps1 index 438d2e09..5feb1113 100644 --- a/tests/Shared/Get-OperaApp.Tests.ps1 +++ b/tests/Shared/Get-OperaApp.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-OracleJava.Tests.ps1 b/tests/Shared/Get-OracleJava.Tests.ps1 index 66e8a018..edd4f786 100644 --- a/tests/Shared/Get-OracleJava.Tests.ps1 +++ b/tests/Shared/Get-OracleJava.Tests.ps1 @@ -3,6 +3,7 @@ Shared Pester function tests. #> [OutputType()] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { diff --git a/tests/Shared/Get-SourceForgeRepoRelease.Tests.ps1 b/tests/Shared/Get-SourceForgeRepoRelease.Tests.ps1 index 9d558ad3..14e5bdb5 100644 --- a/tests/Shared/Get-SourceForgeRepoRelease.Tests.ps1 +++ b/tests/Shared/Get-SourceForgeRepoRelease.Tests.ps1 @@ -4,6 +4,7 @@ #> [OutputType()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "", Justification = "This is OK for the test files.")] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCommands", "", Justification = "PowerShell 7.4 or above will be used")] param () InModuleScope -ModuleName "Evergreen" { From 42235180ef75ce7ccc246d14949b3ed4c74998ca Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Wed, 18 Nov 2026 10:46:05 +1100 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5549dfb..0306825a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change log +## VERSION + +* Added the `Set-ObjectProperty` function to update a property on a PowerShell object when its value matches an expected value, with support for `-WhatIf` and `-Confirm` parameters. +* In `Resolve-MicrosoftFwLink.ps1`, normalized the `Date` field by converting it to a DateTime object using `ConvertTo-DateTime`. +* In `Get-InstallerType.ps1`, added a new installer type `hybridCRT` to the recognized types. +* In `Get-SourceForgeRepoRelease.ps1`, reordered the creation of the output object to group related fields together for clarity. + ## 2611.2874.0 Makes release Date values consistent across Evergreen apps by returning invariant `yyyy-MM-dd` strings instead of culture-dependent DateTime objects. This change is intended to make the `Date` property output more consistent across applications.