Private/UI/Confirm-EwWorkbenchInstallBatch.ps1

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

function Confirm-EwWorkbenchInstallBatch {
    [CmdletBinding()]
    [OutputType([bool])]
    param(
        [Parameter(Mandatory)]
        [object]$Window,

        [Parameter(Mandatory)]
        [AllowEmptyCollection()]
        [psobject[]]$Definition
    )

    $applicationNames = @($Definition | ForEach-Object { [string]$_.Name })
    $applicationLabel = if ($applicationNames.Count -eq 1) { 'application' } else { 'applications' }
    $message = "Install $($applicationNames.Count) $applicationLabel locally?`n`n$($applicationNames -join "`n")"
    return Confirm-EwWorkbenchAction -Window $Window -Title 'Confirm local installation' `
        -Message $message -DefaultYes $false -AcceptText 'Install' -DeclineText 'Cancel'
}