The Teams PowerShell module does not (officially) support app authentication just yet, support should be coming in the next versions. As for the MSOnline module, it's on a deprecation path - use the MG Graph SDK for PowerShell instead. It supports CBA/passing token in the app auth context.
Minimizing prompts when connecting Teams and Sharepoint using powerShell when Multifactor Authentication is enabled .
I'm trying to connect teams and sharepoint using powershell scripts i.e., Connect-MicrosoftTeams -Credential $mycred and Connect-MsolService -Credential $mycred -AzureEnvironment AzureCloud , Credentials which we are using has Multi factor authentication Enabled on them, which shows prompts and error while executing these script. I want to minimize the MFA and login prompt. Is there any way if we can use App Authenticator or any other authentication way to achieve this.