fix: replace backtick-n with [Environment]::NewLine in PS script

Go raw strings (backtick-delimited) cannot contain backticks, so
PowerShell's backtick-n newline literal breaks the Go compiler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jim800121chen 2026-03-26 12:14:07 +08:00
parent c0ffd63507
commit 5e7edea08b

View File

@ -189,12 +189,12 @@ try {
# Step 3: Install driver via pnputil
$pnpResult = & pnputil.exe /add-driver '%s' /install 2>&1
$pnpText = $pnpResult -join "`n"
$pnpText = $pnpResult -join [Environment]::NewLine
# If pnputil failed with signature error, try with /force (Windows 11 23H2+)
if ($LASTEXITCODE -ne 0 -and $pnpText -match '簽章|signature|sign') {
$pnpResult = & pnputil.exe /add-driver '%s' /install /force 2>&1
$pnpText = $pnpResult -join "`n"
$pnpText = $pnpResult -join [Environment]::NewLine
}
# Cleanup cert file