PR suggestions

This commit is contained in:
Ben Hillis 2025-12-08 08:14:49 -08:00
parent 531a3cb786
commit 537d8c8cc5

View File

@ -69,6 +69,7 @@ if ($Package) {
Write-Host "Installing package: $Package"
try {
$installed = $false
if ($AllowUnsigned)
{
# Try to add with -AllowUnsigned first (supported in newer PowerShell)
@ -89,7 +90,7 @@ if ($Package) {
$certPath = Join-Path $env:TEMP "wsl-package-cert.cer"
$cert | Export-Certificate -FilePath $certPath | Out-Null
try {
Import-Certificate -FilePath $certPath -CertStoreLocation Cert:\LocalMachine\Root | Out-Null
Import-Certificate -FilePath $certPath -CertStoreLocation Cert:\CurrentUser\Root | Out-Null
}
finally {
Remove-Item -Path $certPath -ErrorAction SilentlyContinue