From 06afd16ebb3f0ff894b25aab0733b99c487a5315 Mon Sep 17 00:00:00 2001 From: Atis <94861317+AtisFPS@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:55:37 +0200 Subject: [PATCH] Another way to extract the GUID to remove the French part code --- functions/public/Invoke-WPFUltimatePerformance.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/public/Invoke-WPFUltimatePerformance.ps1 b/functions/public/Invoke-WPFUltimatePerformance.ps1 index 1528a0df..70f56646 100644 --- a/functions/public/Invoke-WPFUltimatePerformance.ps1 +++ b/functions/public/Invoke-WPFUltimatePerformance.ps1 @@ -24,12 +24,13 @@ Function Invoke-WPFUltimatePerformance { # Extract the new GUID from the duplicateOutput foreach ($line in $duplicateOutput) { - if ($line -match "GUID du mode de gestion de l'alimentation\s*:\s*([a-fA-F0-9\-]+)") { - $guid = $matches[1] + if ($line -match "\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b") { + $guid = $matches[0] # $matches[0] will contain the first match, which is the GUID Write-Output "GUID: $guid has been extracted and stored in the variable." break } } + } if (-not $guid) { Write-Output "No GUID found in the duplicateOutput. Check the output format."