# Standardized final SUCCESS/FAILED banner for deploy PowerShell scripts. $script:DeployCliResultWidth = 72 function Write-DeployCliResult { param( [Parameter(Mandatory = $true)] [string]$Script, [Parameter(Mandatory = $true)] [bool]$Success, [string]$Summary = '', [string[]]$Details = @() ) $label = if ($Success) { 'SUCCESS' } else { 'FAILED' } $banner = "===== ${label}: $Script =====" $pad = [Math]::Max(0, $script:DeployCliResultWidth - $banner.Length) $line = $banner + ('=' * $pad) Write-Host '' Write-Host $line if ($Summary) { Write-Host $Summary } foreach ($detail in $Details) { if ($detail) { Write-Host $detail } } Write-Host ('=' * $script:DeployCliResultWidth) }