SOLVED

Problem with latest ExchangeOnlineManagement module (2.0.4)

%3CLINGO-SUB%20id%3D%22lingo-sub-2297694%22%20slang%3D%22en-US%22%3EProblem%20with%20latest%20ExchangeOnlineManagement%20module%20(2.0.4)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2297694%22%20slang%3D%22en-US%22%3E%3CP%3EI%20use%20a%20lot%20of%20Windows%20forms%20in%20my%20scripts.%26nbsp%3B%20With%20the%20latest%20release%20of%20the%26nbsp%3B%3CSPAN%3EExchangeOnlineManagement%20module%20(2.0.4)%2C%20the%20authentication%20pop-up%20(when%20used%20with%20Windows%20PowerShell%205.1)%20no%20longer%20appears%20if%20it%20is%20called%20after%20the%20%22New-Object%22%20cmdlet%20is%20called.%26nbsp%3B%20Here%20is%20an%20example%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAdd-Type%20-AssemblyName%20System.Windows.Forms%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%24FormMain%20%3D%20New-Object%20System.Windows.Forms.Form%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EConnect-ExchangeOnline%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWith%20previous%20versions%20of%20the%20module%20(2.0.3)%20and%20earlier%2C%20the%20authentication%20screen%20loads%20with%20no%20problem.%26nbsp%3B%20However%2C%20with%202.0.4%2C%20the%20script%20just%20hangs%20and%20never%20shows%20the%20pop-up.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMoving%20the%20Connect-Exchange%20cmdlet%20first%20it%20not%20an%20easy%20option%20for%20me%20because%20I%20use%20a%20lot%20of%20form%20functionality%20to%20display%20feedback%20when%20O365%20authentication%20is%20happening%20and%20the%20module%20is%20loading.%26nbsp%3B%20I%20would%20like%20to%20use%20the%20latest%20version%20of%20the%20module%20and%20not%20have%20to%20update%20a%20large%20amount%20of%20existing%20scripts.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EDoes%20anyone%20have%20any%20suggestions%20as%20to%20how%20I%20can%20submit%20this%20bug%20to%20the%20module%20developers%2C%20similar%20to%20how%20we%20can%20post%20issues%20on%20a%20GitHub%20repo%20(I%20cannot%20find%20a%20repo%20for%20this%20module).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ENJKWork%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2297694%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

I use a lot of Windows forms in my scripts.  With the latest release of the ExchangeOnlineManagement module (2.0.4), the authentication pop-up (when used with Windows PowerShell 5.1) no longer appears if it is called after the "New-Object" cmdlet is called.  Here is an example:

 

Add-Type -AssemblyName System.Windows.Forms

$FormMain = New-Object System.Windows.Forms.Form

Connect-ExchangeOnline

 

With previous versions of the module (2.0.3) and earlier, the authentication screen loads with no problem.  However, with 2.0.4, the script just hangs and never shows the pop-up.

 

Moving the Connect-Exchange cmdlet first it not an easy option for me because I use a lot of form functionality to display feedback when O365 authentication is happening and the module is loading.  I would like to use the latest version of the module and not have to update a large amount of existing scripts.

 

Does anyone have any suggestions as to how I can submit this bug to the module developers, similar to how we can post issues on a GitHub repo (I cannot find a repo for this module).

 

Thanks

NJKWork

2 Replies
best response confirmed by NJKWork (New Contributor)
Solution
I try it from my side and get a similar issue
but when I try it using PowerShell 7 it works.
I think you might need to consider using PowerShell 7
Thank you for testing and the suggestion.