From 80604f4c18c2cd97872ca0e79f37c2a34a74fad4 Mon Sep 17 00:00:00 2001 From: Frode Flaten <3436158+fflaten@users.noreply.github.com> Date: Sat, 13 Jul 2024 12:12:43 +0000 Subject: [PATCH] Fix Teams check in Invoke-Maester --- powershell/public/Invoke-Maester.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powershell/public/Invoke-Maester.ps1 b/powershell/public/Invoke-Maester.ps1 index 1c46c90b..1ec104a1 100644 --- a/powershell/public/Invoke-Maester.ps1 +++ b/powershell/public/Invoke-Maester.ps1 @@ -136,11 +136,11 @@ Function Invoke-Maester { # Optional. The Teams team where the test results should be posted. # To get the TeamId, right-click on the channel in Teams and select 'Get link to channel'. Use the value of groupId. e.g. ?groupId= - [string] $TeamId = $null, + [string] $TeamId, # Optional. The channel where the message should be posted. e.g. 19%3A00000000000000000000000000000000%40thread.tacv2 # To get the TeamChannelId, right-click on the channel in Teams and select 'Get link to channel'. Use the value found between channel and the channel name. e.g. /channel//my%20channel - [string] $TeamChannelId = $null, + [string] $TeamChannelId, # Skip the graph connection check. # This is used for running tests that does not require a graph connection. @@ -232,7 +232,7 @@ Function Invoke-Maester { $isMail = $null -ne $MailRecipient - $isTeamsChannelMessage = (($null -ne $TeamId) -or ($null -ne $TeamChannelId)) + $isTeamsChannelMessage = -not ([String]::IsNullOrEmpty($TeamId) -or [String]::IsNullOrEmpty($TeamChannelId)) if ($SkipGraphConnect) { Write-Host "🔥 Skipping graph connection check" -ForegroundColor Yellow