-
Notifications
You must be signed in to change notification settings - Fork 50
Slack
Massimo Bonvicini edited this page Aug 27, 2019
·
2 revisions
> Add-LoggingTarget -Name Slack -Configuration @{
WebHook = <NOTSET> # <Required> Sets the Slack Webhook URI (eg. 'https://hooks.slack.com/services/xxxx/xxxx/xxxxxxxxxx')
Channel = <NOTSET> # <Not required> Overrides the default channel of the Webhook (eg. '@username' or '#other-channel')
BotName = <NOTSET> # <Not required> Overrides the default name of the bot (eg. 'PoshLogging')
Level = <NOTSET> # <Not required> Sets the logging format for this target
Format = <NOTSET> # <Not required> Sets the logging format for this target
}
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'}