PS Studio / EXO v3 / 3.1.0 issues

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 9 months and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
kdwisdom
Posts: 25
Last visit: Fri Jan 26, 2024 10:39 am

PS Studio / EXO v3 / 3.1.0 issues

Post by kdwisdom »

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, 2023, 4.8.223
Operating system: Windows 1
PowerShell version(s): v5, v7

*** Please add details and screenshots as needed below. ***

I have been using version 2.0.3 of the EXO PS module successfully the last few years, but was never able to get 2.0.4 or greater to work. Now Microsoft is up to 3.1.0

They are EOLing RPS based modules after June, so the need to get it working is coming quickly.

I've looked at other posts on here, but didn't see a resolution.

I've tried the following suggestions:
- Connecting to ExchangeOnline BEFORE the form loads - doesn't change anything
- Trying it in version 7 of PowerShell - it "Authenticates" but then tells me an error "Coudl not load assembly newtonsoft.json, version 13.0.0.0, publickeytoken.... and then never connects and when continue is clicked, it closes the form.
- Disabling STA mode - doesn't change anything

The issue is the form just hangs and never loads because it's stuck in the PS Module never connecting.

Has anyone successfully gotten this to work with PS Studio?

I would LOVE some help.

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: PS Studio / EXO v3 / 3.1.0 issues

Post by brittneyr »

[Topic moved to PowerShell GUIs forum by moderator]
Brittney
SAPIEN Technologies, Inc.
kdwisdom
Posts: 25
Last visit: Fri Jan 26, 2024 10:39 am

Re: PS Studio / EXO v3 / 3.1.0 issues

Post by kdwisdom »

I think I may have gotten it working:

In the "Startup.pss" file in my project, I added my function: Exchange-Connect there

That function is this:

Code: Select all

Import-Module -Name ExchangeOnlineManagement -RequiredVersion 3.1.0 
$userID = $env:USERNAME + "@mydomain.com"
Connect-ExchangeOnline -UserPrincipalName $userID
That seems to work. Loading it at the top of the form (even the main form) wouldn't work but the startup.pss seems to do the trick. I have some more testing to do, but I hope this remedies it and that all of my existing coding/scripting works as it did before.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PS Studio / EXO v3 / 3.1.0 issues

Post by jvierra »

Adding code to the top oof a form in PSS causes the code to be executed on the forms thread. You must load before calling the form function.
This topic is 9 months and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked