fix(template): Refresh PATH after 7-Zip MSI installation

7-Zip MSI installer adds to system PATH but PowerShell session doesn't
see it until PATH is refreshed. Refresh via:
  $env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' +
              [System.Environment]::GetEnvironmentVariable('PATH', 'User')

Same pattern already used for Git installer. Fixes validation error:
  '7z command resolvable' now passes after installation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simone
2026-05-10 21:29:59 +02:00
parent 3283109bed
commit a981be62f4
+4
View File
@@ -1076,6 +1076,10 @@ if (Test-Path $sevenZipExe) {
throw "7-Zip installation failed (exit $($msiProc.ExitCode))." throw "7-Zip installation failed (exit $($msiProc.ExitCode))."
} }
# 7-Zip MSI adds to PATH; refresh session environment variable
$env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' +
[System.Environment]::GetEnvironmentVariable('PATH', 'User')
Write-Host "7-Zip installed." Write-Host "7-Zip installed."
} }