Skip to content
Massimo Bonvicini edited this page Aug 27, 2019 · 3 revisions

Description

From version 4.3

Usage

> Add-LoggingTarget -Name Teams -Configuration @{
    WebHook     = <NOTSET>          # <Required> Sets the Teams Connector URI (eg. 'https://outlook.office.com/webhook/...')
    Details     = $true             # <Not required> Prints Log message details like PID, caller etc.
    Level       = <NOTSET>          # <Not required> Sets the logging format for this target
    Colors      = @{                # <Not required> Maps log levels to badge colors
        'DEBUG'   = 'blue'
        'INFO'    = 'brightgreen'
        'WARNING' = 'orange'
        'ERROR'   = 'red'
    }
}

Write-Log -Level 'WARNING' -Message 'Hello, Powershell!'
Write-Log -Level 'WARNING' -Message 'Hello, {0}!' -Arguments 'Powershell'
Write-Log -Level 'WARNING' -Message 'Hello, {0}!' -Arguments 'Powershell' -Body @{source = 'Logging'}