Updating which registry tree to query
@@ -21,7 +21,7 @@ if (!$ErrorCount -eq 0) {
}
-$imagePath = (Get-Item -Path HKLM:\SYSTEM\ControlSet001\Services\$serviceName).GetValue('ImagePath')
+$imagePath = (Get-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\$serviceName).GetValue('ImagePath')
$imagePath2 = ($imagePath -split "&s=")[1]
$machineGUID = ($imagePath2 -split "&k=")[0]
Write-Output $machineGUID
