Functions/Dependency-Management.ps1

# Dependency Management Functions

function Test-Command {
    param([string]$Name)
    try {
        $null = Get-Command $Name -ErrorAction Stop
        return $true
    }
    catch {
        return $false
    }
}

function Show-DependencyStatus {
    param([string[]]$Tools = @('git', 'gh', 'nodejs', 'npm', 'docker', 'dotnet'))
    
    Write-Host "=== Dependency Status ===" -ForegroundColor Cyan
    
    foreach ($Tool in $Tools) {
        $IsInstalled = Test-Command -Name $Tool
        $StatusIcon = if ($IsInstalled) { "OK" } else { "X" }
        $StatusColor = if ($IsInstalled) { "Green" } else { "Red" }
        
        Write-Host " $StatusIcon $Tool" -ForegroundColor $StatusColor
    }
}

function Install-RequiredDependencies {
    param([string[]]$Tools = @('git', 'gh', 'nodejs', 'npm', 'docker', 'dotnet'))
    
    Write-Host "=== Installing Required Dependencies ===" -ForegroundColor Cyan
    
    foreach ($Tool in $Tools) {
        if (-not (Test-Command -Name $Tool)) {
            Write-Host "Installing $Tool..." -ForegroundColor Yellow
            Write-Host " Auto-installation not yet implemented" -ForegroundColor Yellow
        }
        else {
            Write-Host " $Tool is already installed" -ForegroundColor Green
        }
    }
}