SCVVM Command freezing in 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.
User avatar
jvierra
Posts: 12895
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SCVVM Command freezing in Forms

Post by jvierra » Thu Sep 27, 2018 11:01 pm

Have you run this in a simple new form with only that code in a button?

User avatar
ITZBund_Ilmenau
Posts: 13
Joined: Thu Aug 24, 2017 11:11 pm

Re: SCVVM Command freezing in Forms

Post by ITZBund_Ilmenau » Thu Oct 11, 2018 11:20 pm

Sorry for the delay.
I've just tried a simple Form instead of a Form Project and the result is the exactly same.

User avatar
jvierra
Posts: 12895
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SCVVM Command freezing in Forms

Post by jvierra » Fri Oct 12, 2018 10:35 am

Many modules cannot be run in a form. This includes many Azure modules. Modules that hang like this can be run as a job in the form and will usually work correctly.

User avatar
ITZBund_Ilmenau
Posts: 13
Joined: Thu Aug 24, 2017 11:11 pm

Re: SCVVM Command freezing in Forms

Post by ITZBund_Ilmenau » Tue Oct 16, 2018 10:12 pm

I've tried implementing this now and it seems to work, even though badly.
The command finally does end after being called, which is great.
The problem is that I have to put a bunch of the code into the job and not just the Set-SCLogicalNetworkDefinition because everything i pass to it (with param or $using:) is deserialized. I can live with that, but not with the output using Receive-Job also being deserialized.
I got past the command and it already looks like another command has the same problem. I'll continue that after my vacation, so thanks for the hint with the jobs.

Locked