module Az.Accounts supported in a GUI/Windows.Forms?

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 2 years and 10 months 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
User avatar
angelofstealth
Posts: 69
Last visit: Wed Sep 28, 2022 10:04 am

module Az.Accounts supported in a GUI/Windows.Forms?

Post by angelofstealth »

Is using module Az.Accounts supported in a GUI/Windows.Forms? Seeing a bunch of articles in regards to Connect-AzAccount; Looking for clarification if this is even supported. Works fine in console/command line. Importing the module just hangs the GUI, any other module works fine.

Version of PS 5.1, have 2.2.8 of Az.Accounts installed.

Thanks,
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: module Az.Accounts supported in a GUI/Windows.Forms?

Post by jvierra »

I have not found any MS online modules that Microsoft has ever said were not supported. Check with Microsoft documentation for the module as they change things with Azure constantly.

Some modules must be imported before the form is called. Use a project to load the module in the "startup.pss" file which executes before the form is called.
User avatar
angelofstealth
Posts: 69
Last visit: Wed Sep 28, 2022 10:04 am

Re: module Az.Accounts supported in a GUI/Windows.Forms?

Post by angelofstealth »

Thanks jvierra, will give that a shot. Appreciate the response, cheers
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: module Az.Accounts supported in a GUI/Windows.Forms?

Post by jvierra »

You are welcome.

One last thing. Learning how to use sophisticated systems like Micorsoft online services is a big challenge even for experienced programmers. Be patient and follow the blogs and the Azure web site and information. The videos have gotten quite good. Also PowerShell was not initially intended to be used with other than simple forms but it can be used in most ways with forms and Net assemblies and with most modules. The trick is to understand the differences between a script running in a form and one running outside of a form. Modules run at a prompt but the threading and behavior of a form can be different so check and experiment with the thread model (STA/MTA).
This topic is 2 years and 10 months 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