From 734b49bc7dea2f65adc7fb6afe93609c5a12c9a0 Mon Sep 17 00:00:00 2001 From: Bjarke Sporring Date: Wed, 14 Jan 2026 16:53:25 +0100 Subject: [PATCH] Add user confirmation for PowerShell 7 terminal integration - Ask user before setting PowerShell 7 as default VSCode terminal - Make PowerShell terminal setup recommended but optional - Add separate tracking for terminal integration result - Update installation summary to show configuration status - Provide clearer feedback on what was configured --- install-prerequisites.ps1 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/install-prerequisites.ps1 b/install-prerequisites.ps1 index 0eb72bb..98028c3 100644 --- a/install-prerequisites.ps1 +++ b/install-prerequisites.ps1 @@ -258,6 +258,7 @@ $results = @{ Git = $false VSCode = $false VSCodeExtensions = $false + VSCodePowerShellIntegration = $null # null = not asked, true = configured, false = skipped/failed Python = $null # null = not attempted, true = success, false = failed WindowsTerminal = $null } @@ -313,6 +314,14 @@ function Install-VSCodeExtension { } function Set-VSCodePowerShellIntegration { + # Ask user if they want to set PowerShell 7 as default terminal + $setAsDefault = Get-UserConfirmation "Set PowerShell 7 as the default terminal in VSCode? (Recommended for this workshop)" + + if (-not $setAsDefault) { + Write-Host " Skipping PowerShell 7 terminal configuration." -ForegroundColor Gray + return $false + } + Write-Host " Configuring PowerShell 7 integration with VSCode..." -ForegroundColor Cyan try { @@ -415,8 +424,9 @@ if ($results.VSCode) { - # Configure PowerShell 7 integration + # Configure PowerShell 7 integration (optional but recommended) $powershellIntegrationResult = Set-VSCodePowerShellIntegration + $results.VSCodePowerShellIntegration = $powershellIntegrationResult $results.VSCodeExtensions = $powershellExtensionResult } @@ -491,11 +501,17 @@ if ($results.VSCode) { if ($results.VSCodeExtensions) { Write-Success " • PowerShell extension" - Write-Success " • PowerShell 7 terminal integration" } else { Write-Warning " • VSCode PowerShell extension may need manual installation" } + + if ($results.VSCodePowerShellIntegration -eq $true) { + Write-Success " • PowerShell 7 terminal integration" + } + elseif ($results.VSCodePowerShellIntegration -eq $false) { + Write-Host " • PowerShell 7 terminal integration: Skipped" -ForegroundColor Gray + } } else { Write-Error "Visual Studio Code - Installation failed or needs restart"