From b68097ebea12fc59a4638698dc6b2b86f6b92b18 Mon Sep 17 00:00:00 2001 From: HugoPBrito Date: Fri, 7 Nov 2025 13:48:10 +0000 Subject: [PATCH] chore: change code order --- prowler/providers/m365/lib/powershell/m365_powershell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prowler/providers/m365/lib/powershell/m365_powershell.py b/prowler/providers/m365/lib/powershell/m365_powershell.py index e245bf4f6e..5dbf2a59c8 100644 --- a/prowler/providers/m365/lib/powershell/m365_powershell.py +++ b/prowler/providers/m365/lib/powershell/m365_powershell.py @@ -221,12 +221,12 @@ class M365PowerShell(PowerShellSession): result = self.execute( '$teamsToken = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$tenantID/oauth2/v2.0/token" -Method POST -Body $teamstokenBody | Select-Object -ExpandProperty Access_Token' ) - result = self.execute_connect( - 'Connect-MicrosoftTeams -AccessTokens @("$graphToken","$teamsToken")' - ) if result != "": logger.error(f"Microsoft Teams connection failed: {result}") return False + self.execute_connect( + 'Connect-MicrosoftTeams -AccessTokens @("$graphToken","$teamsToken")' + ) return True except Exception as e: logger.error(