MyProfile.Tests.ps1

# References:
# 1. Below are the list of predefined vars that can be used:
# - $PSScriptRoot [System defined] The folder path for current scipt file, NOT the caller script to call this function

. "$PSScriptRoot\Common.ps1"

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