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:
@@ -1076,6 +1076,10 @@ if (Test-Path $sevenZipExe) {
|
||||
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."
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user