mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 00:44:55 -06:00
PR suggestions
This commit is contained in:
parent
531a3cb786
commit
537d8c8cc5
@ -69,6 +69,7 @@ if ($Package) {
|
|||||||
|
|
||||||
Write-Host "Installing package: $Package"
|
Write-Host "Installing package: $Package"
|
||||||
try {
|
try {
|
||||||
|
$installed = $false
|
||||||
if ($AllowUnsigned)
|
if ($AllowUnsigned)
|
||||||
{
|
{
|
||||||
# Try to add with -AllowUnsigned first (supported in newer PowerShell)
|
# 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"
|
$certPath = Join-Path $env:TEMP "wsl-package-cert.cer"
|
||||||
$cert | Export-Certificate -FilePath $certPath | Out-Null
|
$cert | Export-Certificate -FilePath $certPath | Out-Null
|
||||||
try {
|
try {
|
||||||
Import-Certificate -FilePath $certPath -CertStoreLocation Cert:\LocalMachine\Root | Out-Null
|
Import-Certificate -FilePath $certPath -CertStoreLocation Cert:\CurrentUser\Root | Out-Null
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
Remove-Item -Path $certPath -ErrorAction SilentlyContinue
|
Remove-Item -Path $certPath -ErrorAction SilentlyContinue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user