< Back

Set-GceManagedInstanceGroup

Mon Jan 13, 2020 11:50 pm

NAME Set-GceManagedInstanceGroup



SYNOPSIS

Changes the data of a Google Compute Engine instance group manager.





SYNTAX

Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Abandon

<SwitchParameter> -InstanceUri <string[]> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Abandon

<SwitchParameter> -InstanceObject <Instance[]> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Delete

<SwitchParameter> -InstanceUri <string[]> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Delete

<SwitchParameter> -InstanceObject <Instance[]> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Recreate

<SwitchParameter> -InstanceUri <string[]> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Recreate

<SwitchParameter> -InstanceObject <Instance[]> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Size <int>

[<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string> -Template

<string> [<CommonParameters>]



Set-GceManagedInstanceGroup [-Project <string>] [-Zone <string>] [-Region <string>] [-Name] <string>

-TargetPoolUri <string[]> [<CommonParameters>]





DESCRIPTION

Changes the data of a Google Compute Engine instance group manager. As a whole, the group can be resized, have its

template set, or have its target pools set. Member instances can be abandoned, deleted, or recreated.





PARAMETERS

-Project <string>

The project that owns the managed instance group.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Zone <string>

The zone the managed instance group is in.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Region <string>

The region the managed instance group is in.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <string>

The name of the managed instance group to change.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Abandon <SwitchParameter>

If set, will abandon the instance specified by InstanceUri or InstanceObject.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Delete <SwitchParameter>

If set, will delete the instance specified by InstanceUri or InstanceObject.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Recreate <SwitchParameter>

If set, will recreate the instance specified by InstanceUri or InstanceObject.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-InstanceUri <string[]>

The uri of the instance to Abandon, Delete or Recreate.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-InstanceObject <Instance[]>

The Instance object to Abandon, Delete or Recreate.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Size <int>

The new target size of the instance group.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Template <string>

Uri to the new template of the instance group.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TargetPoolUri <string[]>

The uris of the new set of target pools.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String[]

The uri of the instance to Abandon, Delete or Recreate.



Google.Apis.Compute.v1.Data.Instance[]

The Instance object to Abandon, Delete or Recreate.





OUTPUTS

Google.Apis.Compute.v1.Data.InstanceGroupManager





---------- EXAMPLE 1 ----------



PS C:\\> Get-GceInstance "my-instance-1" | Set-ManagedInstanceGroup "my-group" -Abandon



Abandons the instance named "my-instance-1". The instance will still exist, but will no longer be a member of the

instance group "my-group". The size of the instance group will decrease to match.

---------- EXAMPLE 2 ----------



PS C:\\> $instanceUri = (Get-GceInstance "my-instance-2").SelfLink

PS C:\\> Set-ManagedInstanceGroup "my-group" -Delete -InstanceUri $instanceUri



Deletes the instance "my-instance-2". The size of the instance group will decrease to match.

---------- EXAMPLE 3 ----------



PS C:\\> Set-GceManagedInstanceGroup "my-group" -Size 5



Changes the target size of managed instance group "my-group" to be 5.

---------- EXAMPLE 4 ----------



PS C:\\> $template = Get-GceInstanceTemplate "new-template"

PS C:\\> Set-GceManagedInstanceGroup "my-group" -Template $template



The tempalte "new-template" becomes the template for all new instances created by managed instance group "my-group"



RELATED LINKS

[Managed Instance Group resource definition]

(https://cloud.google.com/compute/docs/r ... s#resource)