To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build: PowerShell Studio 2022
Operating system: Windows 10,11
PowerShell version(s): 7.2.3
*** Please add details and screenshots as needed below. ***
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Greetings all,
I have reviewed several posts regarding this topic. I'm posting because some of the replies appear contradictory (at least to me ).
My question is fairly straightforward. With the latest version of the ExchangeOnlineManagement module (version 2.0.5), can you display a form (GUI) first and then connect to ExchangeOnline (using the Connect-ExchangeOnline cmdlet)?
I have tried this and it hangs after the banner is displayed. As mentioned in other posts, this scenario described above used to work in WindowsPowerShell 5.1 with the ExchangeOnlineManagement version 2.0.3. It doesn't seem to work with any version above that. Some posts have suggested this does work with PowerShell 7.
Any guidance or clarification will be greatly appreciated.
ExchangeOnline with PowerShell 7
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: ExchangeOnline with PowerShell 7
[Topic moved to PowerShell GUIs forum by moderator]
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: ExchangeOnline with PowerShell 7
Most Azure and "online" products require connection and loading of modules before you display any form. This is mostly due to the "single-threaded" nature of PowerShell. Most APIs rely on being able to control a thread completely until the connection operation is completed. Forms and GUIs tend to disrupt this and cause failures in online connective processes.
This is a condition that Microsoft has not addressed and likely won't as PowerShell was never designed to be implemented as a GUI. It can be used but certain things will not work from within a displayed form. These things can be overcome if you use a compiled program that can be multi-threaded. PowerShell cannot be multi-threaded even though we can create new threads.
My experience with the Exchange module is that it will not work correctly if it is not connected before the GUI is displayed.
This is a condition that Microsoft has not addressed and likely won't as PowerShell was never designed to be implemented as a GUI. It can be used but certain things will not work from within a displayed form. These things can be overcome if you use a compiled program that can be multi-threaded. PowerShell cannot be multi-threaded even though we can create new threads.
My experience with the Exchange module is that it will not work correctly if it is not connected before the GUI is displayed.