Using powershell to query Prism

  • 13 October 2021
  • 1 reply

I have started trying to use powershell 7 to perform queries against Prism Central.

I have been able to install powershell 7 as well as install the nutanix.cli module

I am able to establish a connection to a prism central instance.

Server                :
Version               : pc.2020.9.0.1
UserName              : account@domain
AcceptInvalidSSLCerts : True
ForcedConnection      : False


However when I try some basic commands such as get-cluster and get-vm I get the error

“Get-Cluster: Object reference not set to an instance of an object.”


If someone has an example of a script that works in there environment they can share I can see if I am doing something wrong.

1 reply

Sometimes this happens when the DLL’s do not load. I would try logging out and importing the module again.

ps> exit

ps> Import-Module Nutanix.Cli


Then try get-cluster again.