diff --git a/powershell/public/Invoke-Maester.ps1 b/powershell/public/Invoke-Maester.ps1 index 908ff316..9e228b74 100644 --- a/powershell/public/Invoke-Maester.ps1 +++ b/powershell/public/Invoke-Maester.ps1 @@ -137,11 +137,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. @@ -233,7 +233,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