Teams PowerShell no longer works on MacOS - Windows only dependency after 7.9.0
A critical bug affects Microsoft Teams PowerShell module versions 7.9.0 and later on macOS. Users experience a System.DllNotFoundException for kernel32.dll when attempting interactive sign-in with Connect-MicrosoftTeams. This issue prevents any sign-in prompt from appearing, unlike version 7.8.0 which functions correctly. The problem arises because the module attempts to call a Windows-specific kernel32.dll function on macOS. This call is made through a parent-window callback mechanism used by the Microsoft Authentication Library (MSAL). Since macOS lacks kernel32.dll, the exception is thrown before the interactive sign-in process can even begin. The exception details show .NET's failed attempts to locate kernel32.dll and its variants. Previous versions only set this callback for Windows-specific authentication methods. However, newer versions incorrectly set this callback for interactive sign-in on all platforms. A potential fix involves conditionally applying the callback only on Windows or ensuring it returns a null value on non-Windows systems. Until a permanent solution is released, users can either revert to version 7.8.0 or utilize the device code sign-in option.