Closed JGit85 closed 5 years ago
From testing your code it seems problem is within $Fact. You can't have an empty name. If you give a name it will work.
Describe 'Send-DiscordMessage - Invoke-RestMethod Test' {
It 'Given - Few settings' {
# Discord message/notification configuration
$Uri = $Env:DiscordUrl
$Author = New-DiscordAuthor -Name 'Name' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png"
$Fact = New-DiscordFact -Name 'Test' -Value 'message' -Inline $false
$Thumbnail = New-DiscordThumbnail -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png"
$Section = New-DiscordSection -Title 'message' -Description '' -Facts $Fact -Color Red -Author $Author -Thumbnail $Thumbnail -Image $Thumbnail
Send-DiscordMessage -WebHookUrl $Uri -Sections $Section -AvatarName 'NoPixelChecker' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png"
}
}
I had tested this a few times and had it working, but now without any code changes I am receiving the following:
Any ideas? Here is the snippet of code relating to the discord message: