Skip to content

Unable to execute Get-GceManagedInstanceGroup for specific instance group #670

@marcelvanwaaijen

Description

@marcelvanwaaijen

I am trying to run Get-GceManagedInstanceGroup for a specific managed instance group on a Windows managed instance in GCP.

When I run just the command, it executes fine, but outputs all managed instance groups:

Get-GceManagedInstanceGroup

BaseInstanceName  : xxxx
CreationTimeStamp : 2024-06-01T00:00:00.000-00:00
CurrentActions    : Google.Apis.Compute.v1.Data.InstanceGroupManagerActionsSummary
Description       :
....

But when I specify the name of a specific managed instance group, I get an error specifying that the -Zone must be specified:

Get-GceManagedInstanceGroup -Name "my-mig"

Get-GceManagedInstanceGroup : Parameter Zone was not set and does not have a default value.
At line:1 char:1
+ Get-GceManagedInstanceGroup -Name my-mig
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-GceManagedInstanceGroup], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Google.PowerShell.Compute.GetManagedInstanceGroupCmdlet

And when I add the -Zone, I get an error saying that I also must specify -Region:

Get-GceManagedInstanceGroup -Name "my-mig" -Zone "us-west1-a"

Get-GceManagedInstanceGroup : Parameter Region was not set and does not have a default value.
At line:1 char:1
+ Get-GceManagedInstanceGroup -Name "my-mig" -Zone "us-west1-a"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-GceManagedInstanceGroup], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Google.PowerShell.Compute.GetManagedInstanceGroupCmdlet

Then, when I specify both -Zone and -Region, I get an error saying that I can't use -Zone and -Region together with -Name:

Get-GceManagedInstanceGroup -Name "my-mig" -Zone "us-west1-a" -Region "us-west1"

Get-GceManagedInstanceGroup : Parameters -Region and -Zone cannot be used together with -Name.
At line:1 char:1
+ Get-GceManagedInstanceGroup -Name "my-mig" -Zone "us-west1-a" -Region ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-GceManagedInstanceGroup], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Google.PowerShell.Compute.GetManagedInstanceGroupCmdlet

And when I leave out the -Name and only specify -Zone and -Region, I am prompted to specify the Name:

> Get-GceManagedInstanceGroup -Zone "us-west1-a" -Region "us-west1"
Supply values for the following parameters:
Name: 

On my own laptop I am able to run the command Get-GceManagedInstanceGroup -Name "my-mig" -Zone "us-west1-a" successfully for zonal MIGs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions