From 23089ed85f32344bc8340e7ad76ea9afad1aff73 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 24 Sep 2021 17:10:18 +0200 Subject: [PATCH] Fix #2 staging directory is created silently if not existing --- installUbuntuLTS.ps1 | 3 +++ installWSL2.ps1 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/installUbuntuLTS.ps1 b/installUbuntuLTS.ps1 index f46be70..50b793e 100644 --- a/installUbuntuLTS.ps1 +++ b/installUbuntuLTS.ps1 @@ -5,6 +5,9 @@ Param ( [Parameter(Mandatory=$True)][ValidateNotNull()][string]$installAllSoftware ) +# create staging directory if it does not exists +if (-Not (Test-Path -Path .\staging)) { $dir = mkdir .\staging } + curl.exe -L -o .\staging\ubuntuLTS.appx https://aka.ms/wslubuntu2004 Move-Item .\staging\ubuntuLTS.appx .\staging\$wslName.zip diff --git a/installWSL2.ps1 b/installWSL2.ps1 index 150b42f..80d680e 100644 --- a/installWSL2.ps1 +++ b/installWSL2.ps1 @@ -1,3 +1,6 @@ +# create staging directory if it does not exists +if (-Not (Test-Path -Path .\staging)) { $dir = mkdir .\staging } + curl.exe -L -o .\staging\wsl_update_x64.msi https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi .\staging\wsl_update_x64.msi /quiet