I'm using Write-Color function to write colored messages an I would like to align the status
$file1 = "myFirstFileName.json"
$file2 = "myFile.json"
Function Write-Color([String[]]$Text, [ConsoleColor[]]$ForeGroundColor, [ConsoleColor[]]$BackGroundColor)
{
    for ($i = 0; $i -lt $Text.Length; $i++) {
        $Color = @{ }
        if ($ForeGroundColor -and $BackGroundColor)
        {
            $Color = @{
                ForegroundColor = $ForeGroundColor[$i%($ForeGroundColor.count)]
                BackgroundColor = $BackGroundColor[$i%($BackGroundColor.count)]
            }
        }
        elseif ($ForeGroundColor)
        {
            $Color = @{
                ForegroundColor = $ForeGroundColor[$i%($ForeGroundColor.count)]
            }
        }
        elseif ($BackGroundColor)
        {
            $Color = @{
                BackgroundColor = $BackGroundColor[$i%($BackGroundColor.count)]
            }
        }
        Write-Host $Text[$i] @Color -NoNewLine
    }
    Write-Host
}
Write-Color 'File ', $file1, ' is open'.PadRight(48), '[', ' ERROR! ', ']' -ForeGround Cyan, Yellow, Cyan, White, Red, White
Write-Color 'File ', $file2, ' is open'.PadRight(48), '[', ' ERROR! ', ']' -ForeGround Cyan, Yellow, Cyan, White, Red, White
Result
File myFirstFileName.json is open [ ERROR! ]
File myFile.json is open [ ERROR! ]
Expected Result
File myFirstFileName.json is open [ ERROR! ]
File myFile.json is open [ ERROR! ]