So I was trying out the -parallel parameter of the new Powershell 7 Core, but it doesn't seem to be working with PowerCLI. Here is the simple snippet:
Connect-VIServer "vcenter" -User "user" -Password "pass"
Measure-Command{
$vmArr = Get-VM
$vmArr | ForEach-Object {
Get-SpbmEntityConfiguration -HardDisk (Get-HardDisk -vm $_)
}
}
I'm getting the following error:
Get-HardDisk:
Line |
2 | Get-SpbmEntityConfiguration -HardDisk (Get-HardDisk -vm $_)
| ~~~~~~~~~~~~~~~~~~~
| 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.
Without the -parallel parameter it works fine.
Versions: Powershell Core 7.0, PowerCLI 11.5