if (-not (Get-Command code -ErrorAction SilentlyContinue)) {
Write-Host"VS Code still not found after install. Please restart your shell and re-run this script to complete VS Code setup and extension installation."-ForegroundColor Red
}
}
if (Get-Command code -ErrorAction SilentlyContinue) {
# Critical: C# (csharp), SQL Project, SSMS (mssql), Bicep, YAML (redhat), PowerShell. DBCode and redhat.vscode-yaml are the only non-Microsoft exceptions kept.
$extensions=@(
"ms-dotnettools.csharp",
"ms-dotnettools.vscodeintellicode-csharp",
"ms-vscode.hexeditor",
"ms-vscode.powershell",
"ms-vscode.copilot-mermaid-diagram",
"ms-vscode-remote.remote-wsl",
"redhat.vscode-yaml",
"ms-azuretools.vscode-bicep",
"ms-azuretools.vscode-azureresourcegroups",
"ms-azuretools.vscode-azure-github-copilot",
"GitHub.copilot",
"GitHub.copilot-chat",
"ms-windows-ai-studio.windows-ai-studio",
"ms-mssql.mssql",
"ms-mssql.sql-database-projects-vscode",
"DBCode.dbcode"
)
foreach ($extin$extensions) {
if (-not (code --list-extensions |Select-String-Pattern "^$ext$")) {
Write-Host"\n--- Installing VS Code extension: $ext ---\n"-ForegroundColor Green
Write-Host"SQL Server installation did not complete successfully (exit code $LASTEXITCODE). You may need to retry or install manually."-ForegroundColor Red
} else {
Write-Host"SQL Server Developer installed using default instance settings."-ForegroundColor DarkGray
}
} else {
Write-Host"SQL Server Developer Edition already installed."-ForegroundColor DarkGray
}
if (-not (Get-Command func -ErrorAction SilentlyContinue)) {