MyProfile.Tests.ps1

Import-Module .\

function Test-WriteColorHost
{
    [CmdletBinding()]
    param(
        [Parameter(Position=0)]
        [string] $Prefix
    )

    Write-ColorHost "$($Prefix): Verbose" -Type Verbose
    Write-ColorHost "$($Prefix): Debug" -Type Debug
    Write-ColorHost "$($Prefix): Information" -Type Information
    Write-ColorHost "$($Prefix): Default" -Type Default
    Write-ColorHost "$($Prefix): Highlight" -Type Highlight
    Write-ColorHost "$($Prefix): Warning" -Type Warning
    Write-ColorHost "$($Prefix): Keynote" -Type Keynote
    Write-ColorHost "$($Prefix): Error" -Type Error
}

Test-WriteColorHost "Verbose level" -Verbose
Test-WriteColorHost "Debug level" -Debug
Test-WriteColorHost "Information level" -InformationAction Continue
Test-WriteColorHost "Warning level"
Test-WriteColorHost "Error level" -WarningAction SilentlyContinue
Test-WriteColorHost "All OFF level" -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
Test-WriteColorHost "Mix level" -Debug -ErrorAction SilentlyContinue