google-cloud-powershell icon indicating copy to clipboard operation
google-cloud-powershell copied to clipboard

Object reference not set to an instance of an object - Get-Gceinstance on project with no VMs

Open TitanRob16 opened this issue 5 years ago • 0 comments

This seems to have stopped working for my entire team overnight (it was working fine yesterday). When running Get-gceinstance -Project [projectname] against a project without any VM instances, we receive the error:

Get-gceinstance : Object reference not set to an instance of an object.
At line:1 char:1
+ Get-gceinstance -Project [projectname]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-GceInstance], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Google.PowerShell.ComputeEngine.GetGceInstanceCmdlet

The command works fine when there are instances within the project. I've tried uninstalling and reinstalling the PowerShell module, and I've tried reinstalling the Cloud SDK to no avail. I expect the command to give nothing rather than an error message.

Any help with this would be greatly appreciated.

TitanRob16 avatar Oct 22 '20 10:10 TitanRob16