< Back

Set-GceTargetPool

Mon Jan 13, 2020 11:51 pm

NAME Set-GceTargetPool



SYNOPSIS

Sets data about Google Compute Engine target pools.





SYNTAX

Set-GceTargetPool [-Project <string>] [-Region <string>] [-Name] <string> -RemoveInstance <string[]>

[<CommonParameters>]



Set-GceTargetPool [-Project <string>] [-Region <string>] [-Name] <string> -AddInstance <string[]>

[<CommonParameters>]



Set-GceTargetPool -InputObject <TargetPool> -RemoveInstance <string[]> [<CommonParameters>]



Set-GceTargetPool -InputObject <TargetPool> -AddInstance <string[]> [<CommonParameters>]





DESCRIPTION

Set-GceTargetPool adds and removes instance to and from target pools





PARAMETERS

-Project <string>

The project the target pool belongs to. Defaults to the project in the Cloud SDK config.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Region <string>

The region of the target pool. Defaults to the region in the Cloud SDK config.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <string>

The name of the target pool to change.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InputObject <TargetPool>

The target pool object to change.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-AddInstance <string[]>

A list of instance to add to the target pool. Can take either string urls or

Google.Apis.Compute.v1.Data.Instance objects.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RemoveInstance <string[]>

A list of instance to remove from the target pool. Can take either string urls or

Google.Apis.Compute.v1.Data.Instance objects.



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

Google.Apis.Compute.v1.Data.TargetPool

The target pool object to change.





OUTPUTS

Google.Apis.Compute.v1.Data.TargetPool





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



PS C:\\> $instance = Get-GceInstance "my-instance"

PS C:\\> Get-GceTargetPool "my-pool" | Set-GceTargetPool -AddInstance $instance



This command adds instance "my-instance" to the target pool "my-pool"

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



PS C:\\> Set-GceTargetPool "my-pool" -RemoveInstance $instanceUrl



This command removes the instance pointed to by $instanceUrl from target pool "my-pool".



RELATED LINKS

[Target Pool resource definition] (https://cloud.google.com/compute/docs/r ... s#resource)