diff --git a/resources/NotificationBuilder.psm1 b/resources/NotificationBuilder.psm1 index 0e9b0d5..61d43c5 100644 --- a/resources/NotificationBuilder.psm1 +++ b/resources/NotificationBuilder.psm1 @@ -175,7 +175,7 @@ function New-DiscordPayload { } # Build payload object. - $payload = [PSCustomObject]@{ + [PSCustomObject]$payload = @{ embeds = @( [PSCustomObject]@{ title = $JobName @@ -453,7 +453,7 @@ function New-TeamsPayload { } ) - $payload = [PSCustomObject]@{ + [PSCustomObject]$payload = @{ type = 'message' attachments = @( @{ @@ -517,7 +517,7 @@ function New-SlackPayload { [string]$LatestVersion ) - $payload = [PSCustomObject]@{ + [PSCustomObject]$payload = @{ blocks = @() } @@ -615,7 +615,7 @@ function New-SlackPayload { } # Build payload object. - $payload.blocks += @( + [PSCustomObject]$payload.blocks += @( @{ type = 'section' text = @{ @@ -791,7 +791,7 @@ function New-TelegramPayload { # Compile message parts $message = $mentionStr + $sessionInfo + "`n`n$FooterMessage" - $payload = [PSCustomObject]@{ + [PSCustomObject]$payload = @{ chat_id = $ChatId parse_mode = 'MarkdownV2' text = $message diff --git a/resources/NotificationSender.psm1 b/resources/NotificationSender.psm1 index 21c555a..984c479 100644 --- a/resources/NotificationSender.psm1 +++ b/resources/NotificationSender.psm1 @@ -85,7 +85,7 @@ function Send-WebhookNotification { # Check if user should be mentioned try { if ($params.Mention) { - $Parameters.UserId = $ServiceConfig.user_id + $params.UserId = $ServiceConfig.user_id # Set username if exists (Teams specific) $teamsDisplayName = if ($ServiceConfig.display_name) { $ServiceConfig.display_name } else { $ServiceConfig.user_name }