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
  • Attach files
  • Robert Rudik commented
    8 Jan 02:23pm

    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
    22 Mar, 2018 03:02pm

    @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.

  • Jake Robinson commented
    21 Mar, 2018 07:31pm

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

  • Luc Dekens commented
    21 Mar, 2018 07:18pm

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