Skip to content

Support for multiple Teams channels #111

@kilale

Description

@kilale

Hi,

is there a way to send messages to multiple Teams channels? Maybe switch between channels?
I tried to set the WebHook on demand, sending a message to a different channel, setting the WebHook back to original.

$secondchannel = "WEBHOOK URL"
$defaultchannel = (Get-LoggingTarget -Name Teams).WebHook
(Get-LoggingTarget -Name Teams).WebHook = $secondchannel
Write-Log -Message ....
(Get-LoggingTarget -Name Teams).WebHook = $defaultchannel

But since the logger is running in background, the messages are not send in time to the designated channel.
So sometimes the WebHook value is set back to $defaultchannel, before the logger sends the message to Teams.

Also calling the Wait-Logging function before resetting the WebHook, is not working out reliably.

Maybe there is a proper way to work with different WebHook URLs.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions