Skip to main content

Teams

Teams

Configuration options

OptionTypeMandatoryDefaultDescription
LevelStringNoDefault LevelDefines the lowest logging level to logged
WebHookStringYesN/ASets the Teams Connector URI
DetailsBooleanNo$truePrints Log message details like PID, caller etc.
ColorsHashTableNoDefaults shown in the exampleMaps log levels to badge colors

Example

> Add-LoggingTarget -Name Teams -Configuration @{
WebHook = 'https://outlook.office.com/webhook/...'
Details = $true
Level = 'ALERT'
Colors = @{
'DEBUG' = 'blue'
'INFO' = 'brightgreen'
'WARNING' = 'orange'
'ERROR' = 'red'
'NOTICE' = 'gray'
'VERBOSE' = 'yellow'
'SUCCESS' = 'green'
'CRITICAL' = 'red'
'ALERT' = 'red'
'EMERGENCY' = 'magenta'
}
}

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