Powershell Studio with vCenter 7.0

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.
Post Reply
bullitt773
Posts: 11
Last visit: Fri Jan 21, 2022 6:21 am

Powershell Studio with vCenter 7.0

Post by bullitt773 »

I've been using a PS Studio GUI script to deploy and configure VMs. Been working fine until we upgraded vCenter to 7.0. Now, as soon as the deployment begins, the pop-up box, (generated by PowerCLI) hangs, and the script stops running.
1.jpg
1.jpg (12.57 KiB) Viewed 543 times
jvierra
Posts: 15049
Last visit: Tue Jan 25, 2022 12:00 am
Answers: 17
Has voted: 3 times
Been upvoted: 13 times

Re: Powershell Studio with vCenter 7.0

Post by jvierra »

Sounds like the issue is that something in the threading model of vCenter has changed or has a bug. You need to post your issue to vCenter support first since PowerShell hasn't changed.

A PSS script is just a PowerShell script. When it runs it has no relationship to the tool called PSS. To prove that run the script from the PowerShell CLI.

You can also change the threading model to see if that helps. It may be that the thread of VS is deadlocking the PowerShell thread. WinForms under PowerShell are single threaded. Only vSphere can help you check this although vSphere forums may have others who have seen this with PowerShell. At a minimum you need to provide more information.

Similar things happen with Azure modules due to incorrect load order or loading in a GUI rather than before the GUI is created.
bullitt773
Posts: 11
Last visit: Fri Jan 21, 2022 6:21 am

Re: Powershell Studio with vCenter 7.0

Post by bullitt773 »

Thanks, this runs without issue from PowerCLI. It only locks when running form Studio. You mentioned changing the threading model. Is that something done from PSS or vCenter?
jvierra
Posts: 15049
Last visit: Tue Jan 25, 2022 12:00 am
Answers: 17
Has voted: 3 times
Been upvoted: 13 times

Re: Powershell Studio with vCenter 7.0

Post by jvierra »

PowerCLI is NOT PowerShell. It is a custom designed shell and IDE that is like PSS and designed to execute vSphere code.

Run under normal PowerShell directly. Pay attention to the other two suggestions I made in the last reply.
bullitt773
Posts: 11
Last visit: Fri Jan 21, 2022 6:21 am

Re: Powershell Studio with vCenter 7.0

Post by bullitt773 »

I understand the distiction between powercli, and powershell. I was just saying that when I run this script via powershell directly, there is no issue.

Also, you mentioned modifying the threading model. Where and how is that done?
jvierra
Posts: 15049
Last visit: Tue Jan 25, 2022 12:00 am
Answers: 17
Has voted: 3 times
Been upvoted: 13 times

Re: Powershell Studio with vCenter 7.0

Post by jvierra »

Without more information about how you are running it the reis no way to know what might be happening. Since the script runs under PowerShell then you are referencing issues with how to use PSS and not issues with code or PowerShell itself.

For issues with the Sapien product, I recommend posting in the Sapien customer support forum for PSS.
Post Reply