VMware PowerCLI

The Best User Interface for your VMware Datacenter!

PowerCLI 10 compatibility with PoshRSJob

Now that we have a new version of PowerCLI being developed, could we get you all to add compatibility for PowerCLI cmdlets with the PoshRSJob module? I have been struggling with this for about a year now, and I think this may be the opportunity to actually get it done. Any and all help is greatly appreciated.

I use the attached script and get the following error from most jobs. It has something to do with the global DefaultVIServer and DefaultVIServers variables, but I haven't been able to find a way around it...

Error: You have modified the global:DefaultVIServer and global:DefaultVIServers system variables. This is not allowed. Please reset them to $null and reconnect to the vSphere server.

  • Cole Reynolds
  • Mar 21 2018
  • Delivered
  • Attach files
  • Admin
    Kamen Nikolov commented
    January 13, 2022 15:15

    Shipped in PowerCLI 12.2

  • Robert Rudik commented
    January 08, 2020 14:23

    This drives me crazy as well since I run things against 40+ vCenter servers and thats not fun anymore. The only thing is to use Out Of Process Runspaces.

    @Cole - I modified your code using out of process runspaces. It should work now. Read comments in file for more details.

    I hope this unpleasant PowerCLI behavior will be solved soon.

     

     

  • Cole Reynolds commented
    March 22, 2018 15:02

    @Jake - Negative. I tried that yesterday and the jobs take much longer than they should or you would expect, and the results aren't consistent. Some jobs still throw some weird errors. All of that was seen with the throttle set to 10. Not sure what kind of results you'd see if you tried any more than that.

  • Deleted User commented
    March 21, 2018 19:31

     Will `Connect-VIServer -Session <SessionID>` not help with this?

  • Luc Dekens commented
    March 21, 2018 19:18

    Great idea!
    Suggest to make it more general, "support Runspaces".