Add ValueKind validation and fix string unescaping in Convert-RegValueData

This commit is contained in:
Jeffrey
2026-05-28 23:25:27 +02:00
parent 7273f29fea
commit b920536be2
2 changed files with 19 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ function Convert-RegValueData {
if ($valueData -match '^"(?<value>.*)"$') {
$stringValue = $matches.value
# Unescape registry string escape sequences
$stringValue = $stringValue -replace '\\\\', '\' -replace '\"', '"'
$stringValue = $stringValue -replace '\\"', '"' -replace '\\\\', '\'
return [PSCustomObject]@{
OperationType = 'SetValue'
ValueType = 'String'