From ec7e9a546cc7da79ee4b12325953c08ca768a0f1 Mon Sep 17 00:00:00 2001 From: Zehadi Alam <63765084+zehadialam@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:08:09 -0400 Subject: [PATCH] Adjust pattern for URL scraping --- FFUDevelopment/BuildFFUVM.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 4c2cec4..101df9c 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -2321,7 +2321,7 @@ function Get-MSRTUrl { ) try { # Retrieve content of Windows Malicious Software Removal Tool page - $pattern = '\"url\":\"(https://download\.microsoft\.com/download/[^"]+)\"' + $pattern = 'https:\/\/download\.microsoft\.com\/download\/[^\s]*\.exe' $OriginalVerbosePreference = $VerbosePreference $VerbosePreference = 'SilentlyContinue' if ($WindowsArch -eq "x64") { @@ -2337,7 +2337,7 @@ function Get-MSRTUrl { WriteLog "Failed to retrieve Malicious Software Removal Tool URL. Pattern match failed" return } - $MSRTUrl = $MSRTMatch.Groups[1].Value + $MSRTUrl = $MSRTMatch.Value return $MSRTUrl } catch {