From eb854efc5efc92a8aea9106d4fff4d4b52c4cc34 Mon Sep 17 00:00:00 2001 From: Szymon Osiecki Date: Tue, 26 Sep 2023 18:30:46 +0200 Subject: [PATCH 1/3] docs(sh): install_azurecli WSL1/conda GH issue proper link. --- .assets/provision/install_azurecli.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.assets/provision/install_azurecli.sh b/.assets/provision/install_azurecli.sh index a10bee25..1937129e 100755 --- a/.assets/provision/install_azurecli.sh +++ b/.assets/provision/install_azurecli.sh @@ -44,10 +44,9 @@ if ! conda env list | grep -qw '^azurecli'; then if uname -r 2>&1 | grep -qw 'WSL2'; then conda create --name azurecli --yes python=3.10 pip else - # https://github.com/microsoft/WSL/issues/4020 + # https://github.com/conda/conda/issues/12051 conda create --name azurecli --yes python=3.10 pip numpy-base fi - fi conda activate azurecli pip install -U azure-cli From ed7221a1ea93bb8c0fd0932dc8fd3c217144e98b Mon Sep 17 00:00:00 2001 From: Szymon Osiecki Date: Tue, 26 Sep 2023 21:00:25 +0200 Subject: [PATCH 2/3] refactor(ps): wsl_certs_add Import do-common module instead of always cloning repo. --- wsl/wsl_certs_add.ps1 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wsl/wsl_certs_add.ps1 b/wsl/wsl_certs_add.ps1 index e01893a0..a327079a 100644 --- a/wsl/wsl_certs_add.ps1 +++ b/wsl/wsl_certs_add.ps1 @@ -48,11 +48,15 @@ begin { # set location to workspace folder Push-Location "$PSScriptRoot/.." # clone/refresh szymonos/ps-modules repository - if (.assets/tools/gh_repo_clone.ps1 -OrgRepo 'szymonos/ps-modules') { - # import the do-common module for certificate functions - Import-Module -Name (Resolve-Path '../ps-modules/modules/do-common') - } else { - Write-Error 'Cloning ps-modules repository failed.' + try { + Import-Module do-common -MinimumVersion 0.27 + } catch { + if (.assets/tools/gh_repo_clone.ps1 -OrgRepo 'szymonos/ps-modules') { + # import the do-common module for certificate functions + Import-Module -Name (Resolve-Path '../ps-modules/modules/do-common') + } else { + Write-Error 'Cloning ps-modules repository failed.' + } } # determine update ca parameters depending on distro From 378ff0c553d62c68a9be8dcee07e3d53f7069747 Mon Sep 17 00:00:00 2001 From: Szymon Osiecki Date: Tue, 26 Sep 2023 21:01:27 +0200 Subject: [PATCH 3/3] refactor(ps): wsl_setup Always clone/refresh ps-modules repo. --- wsl/wsl_setup.ps1 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/wsl/wsl_setup.ps1 b/wsl/wsl_setup.ps1 index 16dfb851..53bd0454 100644 --- a/wsl/wsl_setup.ps1 +++ b/wsl/wsl_setup.ps1 @@ -294,13 +294,11 @@ process { } # *install PowerShell modules from ps-modules repository if ($chk.shell) { - # ps-modules repo is being cloned/refreshed on adding certificates - if (-not $AddCertificate) { - if (.assets/tools/gh_repo_clone.ps1 -OrgRepo 'szymonos/ps-modules') { - Write-Verbose 'ps-modules repository cloned successfully.' - } else { - Write-Error 'Cloning ps-modules repository failed.' - } + # clone/refresh szymonos/ps-modules repository + if (.assets/tools/gh_repo_clone.ps1 -OrgRepo 'szymonos/ps-modules') { + Write-Verbose 'ps-modules repository cloned successfully.' + } else { + Write-Error 'Cloning ps-modules repository failed.' } Write-Host 'installing ps-modules...' -ForegroundColor Cyan Write-Host "`e[3mAllUsers`e[23m : do-common" -ForegroundColor DarkGreen