Repository: microsoft/PowerToys
File: tools/build/setup-dev-environment.ps1 (PowerShell)

Code before:
    }
} else {
    Write-Host "[2/4] Skipping Developer Mode check" -ForegroundColor DarkGray
}

Write-Host ""

# Step 3: Install Visual Studio Components
if (-not $SkipVSComponents) {
    Write-Host "[3/4] Checking Visual Studio components"

    $vsConfigPath = Join-Path $repoRoot ".vsconfig"
    if (-not (Test-Path $vsConfigPath)) {
        Write-Warning "  .vsconfig not found at $vsConfigPath"
    } else {
        $vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"

        if (-not $VSInstallPath -and (Test-Path $vsWhere)) {
            $VSInstallPath = & $vsWhere -latest -property installationPath 2>$null
        }

        if (-not $VSInstallPath) {
            $commonPaths = @(
                "${env:ProgramFiles}\Microsoft Visual Studio\2026\Enterprise",
                "${env:ProgramFiles}\Microsoft Visual Studio\2026\Professional",
                "${env:ProgramFiles}\Microsoft Visual Studio\2026\Community",
                "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise",
                "${env:ProgramFiles}\Microsoft Visual Studio\2022\Professional",
                "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community"
            )
            foreach ($path in $commonPaths) {
                if (Test-Path $path) {
                    $VSInstallPath = $path
                    break
                }
            }
        }

        if (-not $VSInstallPath -or -not (Test-Path $VSInstallPath)) {
            Write-Warning "  Could not find Visual Studio installation"
            Write-Warning "  Please install Visual Studio 2026 (or 2022 17.4+) and try again, or import .vsconfig manually"
        } else {
            Write-Host "  Found: $VSInstallPath" -ForegroundColor DarkGray

            $vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"

            if (Test-Path $vsInstaller) {
                Write-Host ""
                Write-Host "  To install required components:"
                Write-Host ""
                Write-Host "  Option A - Visual Studio Installer GUI:"

Review comment (suggestion):
```suggestion
                "${env:ProgramFiles}\Microsoft Visual Studio\18\Enterprise",
                "${env:ProgramFiles}\Microsoft Visual Studio\18\Professional",
                "${env:ProgramFiles}\Microsoft Visual Studio\18\Community",
```

Code after:
    }
} else {
    Write-Host "[2/4] Skipping Developer Mode check" -ForegroundColor DarkGray
}

Write-Host ""

# Step 3: Install Visual Studio Components
if (-not $SkipVSComponents) {
    Write-Host "[3/4] Checking Visual Studio components"

    $vsConfigPath = Join-Path $repoRoot ".vsconfig"
    if (-not (Test-Path $vsConfigPath)) {
        Write-Warning "  .vsconfig not found at $vsConfigPath"
    } else {
        $vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"

        if (-not $VSInstallPath -and (Test-Path $vsWhere)) {
            $VSInstallPath = & $vsWhere -latest -property installationPath 2>$null
        }

        if (-not $VSInstallPath) {
            $commonPaths = @(
                "${env:ProgramFiles}\Microsoft Visual Studio\18\Enterprise",
                "${env:ProgramFiles}\Microsoft Visual Studio\18\Professional",
                "${env:ProgramFiles}\Microsoft Visual Studio\18\Community",
                "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise",
                "${env:ProgramFiles}\Microsoft Visual Studio\2022\Professional",
                "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community"
            )
            foreach ($path in $commonPaths) {
                if (Test-Path $path) {
                    $VSInstallPath = $path
                    break
                }
            }
        }

        if (-not $VSInstallPath -or -not (Test-Path $VSInstallPath)) {
            Write-Warning "  Could not find Visual Studio installation"
            Write-Warning "  Please install Visual Studio 2026 (or 2022 17.4+) and try again, or import .vsconfig manually"
        } else {
            Write-Host "  Found: $VSInstallPath" -ForegroundColor DarkGray

            $vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"

            if (Test-Path $vsInstaller) {
                Write-Host ""
                Write-Host "  To install required components:"
                Write-Host ""
                Write-Host "  Option A - Visual Studio Installer GUI:"