Does the Dashobard use Runspaces?

I was asking a little quastion on the VMWare forum regarding that everytime I run a script (posted in the link) I get a error messages but in Native PowerShell console it works also it works if I run it inside the script section of PowerShell Universal. But it don’t work in the Dashboard.

The was asking if PowerShell Universal Dashboard are using Runspaces?

Product: PowerShell Universal
Version: 1.4.6

PSU uses runspaces extensively. Every page load and event handler will use a new runspace from the runspace pool. The runspace pool will have 2x the number of CPU cores you have available on your machine.

If you are having problems with PowerCLI and it’s not thread safe, you may need to use Invoke-Command to start an external PS process to run the operations that require the use of this module.

I have tried everything it feels like, directly when I try to pass parameters from the invoake-uascript then it stops working the script don’t even run but when I run it without paramters it works fine.

$Script = Get-UAScript -Name 'CreateVDI.ps1'
Invoke-UAScript -Script $Script -AppToken $AppToken -PODSite $PODSite -VDIType $VDIType -VDIADName $VDIADName -VDIADUsr $VDIADUsr -VDIObj $VDIObj -VDIOrder $VDIOrder -VDIKst $VDIKst | Wait-UAJob -Timeout 60

In your dashboard page of the admin console, do you see any errors in the log?

When I did remove $Script = Get-UAScript -Name ‘CreateVDI.ps1’ then it started to work :slight_smile: