From 8ec34cb39e971d7ee03a5985656015f52f13e18b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 19 Sep 2024 21:59:01 +0200 Subject: [PATCH] Make profile dialogue platform independent --- scripts/Common/Scripts/Config.ps1 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/Common/Scripts/Config.ps1 b/scripts/Common/Scripts/Config.ps1 index b3b6097d..9d2d7908 100644 --- a/scripts/Common/Scripts/Config.ps1 +++ b/scripts/Common/Scripts/Config.ps1 @@ -51,7 +51,7 @@ $null = New-Module { $profiles = & { . "$PSScriptRoot/SoftwareManagement.ps1"; - if (Test-Command "wsl") { + if (-not $IsWindows -or (Test-Command "wsl")) { return Invoke-ConfigScript "getProfiles"; } else { return Get-ChildItem "$PSScriptRoot/../../../.config" | ForEach-Object { Split-Path -LeafBase $_ }; @@ -61,16 +61,20 @@ $null = New-Module { $choice = $Host.UI.PromptForChoice( "Select Profile", (& { - switch (Get-Stage) { - ([WindowsInstallerAction]::Backup) { - "Which profile do you wish to back up?"; - } - ([WindowsInstallerAction]::Install) { - "Which profile do you wish to install?"; - } - $null { - "Which profile do you wish to set up?"; + if ($IsWindows) { + switch (Get-Stage) { + ([WindowsInstallerAction]::Backup) { + "Which profile do you wish to back up?"; + } + ([WindowsInstallerAction]::Install) { + "Which profile do you wish to install?"; + } + $null { + "Which profile do you wish to set up?"; + } } + } else { + "Please select a profile:"; } }), (& {