Hi old scripts does not work after upgrading to latest version.
$vmname = <vm>
$cluster = Get-cluster -vm $vmname
has worked so far - but in latest version it retruns error:
get-cluster : 28-04-2020 10:33:04 Get-Cluster Value cannot be null.
Parameter name: collection
$cluster = Get-vm $vmname | get-cluster
Same thing observed for Remove-vm command.
That type of error has been seen before.
Most of the time it indicates an incorrect installation.
From which PowerCLI version did you upgrade?
And to which version?
Did you follow the steps in Welcome PowerCLI to the PowerShell Gallery – Install Process Updates and more particularly in Updating PowerCLI through the PowerShell Gallery?
And you are sure there are no folders left from a pre-6.5.1 PowerCLI version?
What does the following show?
As an ultimate procedure, perhaps remove all PowerCLI related folders and do the Install-Module once more.
Seems to be problem on a seperate server - just tested on a server running 11.5 - works - and on another also running 12. 0 - works, so I'll invesitage why this is a local problem just on one installation.