mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
Another way to extract the GUID to remove the French part code
This commit is contained in:
parent
1adc239c3a
commit
06afd16ebb
@ -24,12 +24,13 @@ Function Invoke-WPFUltimatePerformance {
|
|||||||
|
|
||||||
# Extract the new GUID from the duplicateOutput
|
# Extract the new GUID from the duplicateOutput
|
||||||
foreach ($line in $duplicateOutput) {
|
foreach ($line in $duplicateOutput) {
|
||||||
if ($line -match "GUID du mode de gestion de l'alimentation\s*:\s*([a-fA-F0-9\-]+)") {
|
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[1]
|
$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."
|
Write-Output "GUID: $guid has been extracted and stored in the variable."
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (-not $guid) {
|
if (-not $guid) {
|
||||||
Write-Output "No GUID found in the duplicateOutput. Check the output format."
|
Write-Output "No GUID found in the duplicateOutput. Check the output format."
|
||||||
|
Loading…
Reference in New Issue
Block a user