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
This commit is contained in:
Bjarke Sporring
2026-01-14 16:53:25 +01:00
parent 985c4a0a8a
commit 734b49bc7d

View File

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