datagridview not populating

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 3 years and 8 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
Shrek1515
Posts: 10
Last visit: Sat Oct 24, 2020 12:32 pm

Re: datagridview not populating

Post by Shrek1515 »

I suppose that is where the problem might be as clicking on button2 causes the form to freeze. Just do not know how to direct the output of the get-azvm to datagridview. Is there a way to troubleshoot?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: datagridview not populating

Post by jvierra »

The Azure CmdLets are not compatible with forms in many cases. You can try to run the command in a job and see if that allows it to complete.
Shrek1515
Posts: 10
Last visit: Sat Oct 24, 2020 12:32 pm

Re: datagridview not populating

Post by Shrek1515 »

Wonder what is the official line with regard to Azure commands and PowerShell Studio. As our most resources are in Azure, and if they are not supported with PowerShell Studio, then we would not be beneficial using this nice software.

Thanks.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: datagridview not populating

Post by Alexander Riedel »

The official line is that some Azure commands can have threading requirements that collide with those of Windows Forms. Both are Microsoft Technologies and as you can imagine we have no control over either.
That has little to do with PowerShell Studio. But we continuously work to provide ways to integrate technologies with one another that otherwise won't work.
In your case, you will have to learn to use a job tracker and run some commands or scriptblocks in a separate job. Writing software that is asynchronous and event driven is quite different from creating linear command line scripts, that is certain. But since user interface have to react to software events as well as user input, that is simply a requirement.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1671
Last visit: Tue Apr 16, 2024 8:16 am
Answers: 39
Been upvoted: 31 times

Re: datagridview not populating

Post by brittneyr »

You may find the following article helpful:
https://www.sapien.com/blog/2018/08/07/ ... functions/
Brittney
SAPIEN Technologies, Inc.
Shrek1515
Posts: 10
Last visit: Sat Oct 24, 2020 12:32 pm

Re: datagridview not populating

Post by Shrek1515 »

Thank you Alexander.

Kind regards,
Shrek1515
Posts: 10
Last visit: Sat Oct 24, 2020 12:32 pm

Re: datagridview not populating

Post by Shrek1515 »

Thank you brittneyr too.

Kind regards,
This topic is 3 years and 8 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