private/Write-Version.ps1
function Write-Versions{ param($versions, $operator, $brand, $env, $module, $latestVersion, [RELEASE]$release, $prefix, [switch]$moduleAnalysis) foreach ($_item in $versions) { $_condition = ($null -eq $operator -or $_item.operator -eq $operator) -and ($null -eq $brand -or $_item.brand -eq $brand) -and ($null -eq $env -or $_item.env -eq $env) ` -and (($_item.Module -eq $module) -and ((Compare-Release $_item.Version $latestVersion) -eq $release)) if ( $_condition) { $_color = (Get-Color $release) if ($moduleAnalysis){ if ($_item.Brand){ $_output = ([string]$_item.Operator + '-' + $_item.Brand + ' @ ' + [string]$_item.env).PadRight(18,' ') + "v" + $_item.Version } else { $_output = ([string]$_item.Operator + ' @ ' + [string]$_item.env).PadRight(18,' ') + "v" + $_item.Version } } else { if ($_item.Brand){ $_output = $_item.module.PadRight(13,' ') + ' v' + $_item.Version.PadRight(10,' ') + '-> v' + $latestVersion } else { $_output = $_item.module.PadRight(13,' ') + ' v' + $_item.Version.PadRight(10,' ') + '-> v' + $latestVersion } } Write-Host "$($prefix)" -ForegroundColor $_color -NoNewline Write-Host "$($_output)" } } } |