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.
Shrek1515
Posts: 10
Joined: Tue Jul 28, 2020 8:37 am

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: 14667
Joined: Tue May 22, 2007 9:57 am
Answers: 5
Has voted: 1 time
Been upvoted: 5 times
Contact:

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
Joined: Tue Jul 28, 2020 8:37 am

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: 7556
Joined: Tue May 29, 2007 4:43 pm
Answers: 1
Been upvoted: 4 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: 637
Joined: Thu Jun 01, 2017 7:20 am
Answers: 8
Been upvoted: 6 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 Ryn
SAPIEN Technologies, Inc.

Shrek1515
Posts: 10
Joined: Tue Jul 28, 2020 8:37 am

Re: datagridview not populating

Post by Shrek1515 »

Thank you Alexander.

Kind regards,

Shrek1515
Posts: 10
Joined: Tue Jul 28, 2020 8:37 am

Re: datagridview not populating

Post by Shrek1515 »

Thank you brittneyr too.

Kind regards,

Locked