# Samy.Apps.ps1
# Winget app handlers

function Invoke-InstallChrome {
    param($Context)

    try {
        winget install --id=Google.Chrome --silent --accept-package-agreements --accept-source-agreements
        Write-LogHybrid "Installed Google Chrome via winget" Success SVSApps -LogToEvent
        Send-Text $Context "Chrome installed"
    }
    catch {
        Write-LogHybrid "Chrome install failed: $($_.Exception.Message)" Error SVSApps -LogToEvent
        Send-Text $Context "ERROR: $($_.Exception.Message)"
    }
}

function Invoke-InstallAcrobat {
    param($Context)

    try {
        winget install --id=Adobe.Acrobat.Reader.64-bit --silent --accept-package-agreements --accept-source-agreements
        Write-LogHybrid "Installed Adobe Acrobat Reader (64-bit) via winget" Success SVSApps -LogToEvent
        Send-Text $Context "Acrobat Reader installed"
    }
    catch {
        Write-LogHybrid "Acrobat install failed: $($_.Exception.Message)" Error SVSApps -LogToEvent
        Send-Text $Context "ERROR: $($_.Exception.Message)"
    }
}
