lib/Classes/Public/TMBrokerOutput.ps1

class TMBrokerOutput {

    #region Static Methods

    static [void]Info([Object]$Object) {
        Write-Host -Object "$([TMBrokerOutput]::Timestamp()) $Object"
    }

    static [void]Info([Object]$Object, [ConsoleColor]$ForegroundColor) {
        Write-Host -Object "$([TMBrokerOutput]::Timestamp()) $Object" -ForegroundColor $ForegroundColor
    }

    static [void]Info([Object]$Object, [Boolean]$NoNewLine) {
        Write-Host -Object "$([TMBrokerOutput]::Timestamp()) $Object" -NoNewline:$NoNewLine
    }

    static [void]Info([Object]$Object, [ConsoleColor]$ForegroundColor, [Boolean]$NoNewLine) {
        Write-Host -Object "$([TMBrokerOutput]::Timestamp()) $Object" -ForegroundColor $ForegroundColor -NoNewline:$NoNewLine
    }

    static [void]Verbose([String]$Message) {
        Write-Verbose -Message "$([TMBrokerOutput]::Timestamp()) $Message"
    }

    static [void]Debug([String]$Message) {
        Write-Debug -Message "$([TMBrokerOutput]::Timestamp()) $Message"
    }

    static [void]Warning([String]$Message) {
        Write-Warning -Message "$([TMBrokerOutput]::Timestamp()) $Message"
    }

    static [void]Error([String]$Message) {
        Write-Error -Message "$([TMBrokerOutput]::Timestamp()) $Message"
    }

    static [void]Throw([String]$Message) {
        throw "$([TMBrokerOutput]::Timestamp()) $Message"
    }

    static [String]Timestamp() {
        return "[$(Get-Date -Format "MM/dd/yyyy HH:mm:ss.ffff")]"
    }

    #endregion Static Methods

}