From 2cd001c29de667c82db3de3e4e92d48cce5a761e Mon Sep 17 00:00:00 2001 From: Romain Wager <0x@romainwager.com> Date: Fri, 20 Nov 2026 15:31:05 +0100 Subject: [PATCH] Fix fwlink version in parent path #953 Resolve-MicrosoftFwLink only matched a version in the file name of the resolved URL. Microsoft Outlook has it in the parent folder, so the version came back as Unknown. Check the file name first, then the parent path segments from the closest outwards. The query string is still ignored. --- Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 | 16 ++++++++++------ tests/Shared/Resolve-MicrosoftFwLink.Tests.ps1 | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 index 718298c0..4eb47770 100644 --- a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 +++ b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 @@ -46,13 +46,17 @@ function Resolve-MicrosoftFwLink { $ResolvedUrl = Resolve-SystemNetWebRequest @params # Find a version number in the final URL path, excluding query parameters. - $FileName = [System.IO.Path]::GetFileName($ResolvedUrl.ResponseUri.AbsolutePath) - $VersionMatch = [RegEx]::Match($FileName, "(?