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 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 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