19 lines
722 B
PowerShell
19 lines
722 B
PowerShell
param(
|
|
[Parameter(Mandatory = $true)][string]$Manifest,
|
|
[string[]]$Product = @('all'),
|
|
[switch]$Json
|
|
)
|
|
. (Join-Path $PSScriptRoot 'coordination-common.ps1')
|
|
|
|
try {
|
|
$configuration = Read-CoordinationManifest -Manifest $Manifest
|
|
$selection = Resolve-CoordinationSelection -Configuration $configuration -Product $Product -Operation status
|
|
$result = @($selection | ForEach-Object { Get-CoordinationProductStatus -Configuration $configuration -Product $_ })
|
|
if ($Json) { $result | ConvertTo-Json -Depth 4 } else { $result | Format-Table -AutoSize }
|
|
if (@($result | Where-Object Status -ne 'running').Count -gt 0) { exit 3 }
|
|
exit 0
|
|
} catch {
|
|
Write-Error $_.Exception.Message
|
|
exit 1
|
|
}
|