private/Out-MultiColorExtended.ps1

Function Out-MultiColorExtended
{
    param (
        [string] $firstPart,
        [ConsoleColor] $firstColor,
        [string] $secondPart,
        [ConsoleColor] $secondColor,
        [string] $thirdPart,
        [ConsoleColor] $thirdColor,
        [string] $fourthPart,
        [ConsoleColor] $fourthColor,
        [switch] $NoNewline
    )
    Write-Host $firstPart -NoNewLine -ForegroundColor $firstColor
    Write-Host $secondPart -NoNewline -ForegroundColor $secondColor
    Write-Host $thirdPart -NoNewLine -ForegroundColor $thirdColor
    if ($NoNewline) {
        Write-Host $fourthPart -NoNewline -ForegroundColor $fourthColor
    } else {
        Write-Host $fourthPart -ForegroundColor $fourthColor
    }
}