< Back
Set-GceInstance
Post
NAME Set-GceInstance
SYNOPSIS
Sets various attributes of a VM instance.
SYNTAX
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> -NetworkInterface <string> [-AddAccessConfig
<AccessConfig[]>] [-RemoveAccessConfig <string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-AddDisk <object[]>] [-RemoveDisk
<string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-TurnOnAutoDeleteDisk <string[]>]
[-TurnOffAutoDeleteDisk <string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-AddMetadata <Hashtable>] [-RemoveMetadata
<string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-AddTag <string[]>] [-RemoveTag <string[]>]
[<CommonParameters>]
Set-GceInstance [-Object] <Instance> -NetworkInterface <string> [-AddAccessConfig <AccessConfig[]>]
[-RemoveAccessConfig <string[]>] [<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-AddDisk <object[]>] [-RemoveDisk <string[]>] [<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-TurnOnAutoDeleteDisk <string[]>] [-TurnOffAutoDeleteDisk <string[]>]
[<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-AddMetadata <Hashtable>] [-RemoveMetadata <string[]>] [<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-AddTag <string[]>] [-RemoveTag <string[]>] [<CommonParameters>]
DESCRIPTION
With this cmdlet, you can update metadata, attach and detach disks, add and remove access configs, or add and
remove tags.
PARAMETERS
-Project <string>
The project that owns the instance to update.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Zone <string>
The zone in which the instance resides.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <string>
The name of the instance to update.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Object <Instance>
The instance object to update.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-NetworkInterface <string>
The name of the network interface to add or remove access configs.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AddAccessConfig <AccessConfig[]>
The new access config to add to a network interface.
Required? false
Position? named
Default value Google.Apis.Compute.v1.Data.AccessConfig[]
Accept pipeline input? false
Accept wildcard characters? false
-RemoveAccessConfig <string[]>
The name of the access config to remove from the network interface.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-AddDisk <object[]>
The disk to attach. Can the name of a disk, a disk object from Get-GceDisk, or an attached disk object from
New-GceAttachedDiskConfig.
Required? false
Position? named
Default value System.Object[]
Accept pipeline input? false
Accept wildcard characters? false
-RemoveDisk <string[]>
The name of the disk to detach.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-TurnOnAutoDeleteDisk <string[]>
The names of the disks to turn on autodelete.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-TurnOffAutoDeleteDisk <string[]>
The names of the disks to turn off autodelete.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-AddMetadata <Hashtable>
The keys and values of the metadata to add.
Required? false
Position? named
Default value System.Collections.Hashtable
Accept pipeline input? false
Accept wildcard characters? false
-RemoveMetadata <string[]>
The keys of the metadata to remove.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-AddTag <string[]>
The tag to add.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-RemoveTag <string[]>
The tag to remove.
Required? false
Position? named
Default value System.String[]
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 name of the instance to update.
Google.Apis.Compute.v1.Data.Instance
The instance object to update.
OUTPUTS
Google.Apis.Compute.v1.Data.Instance
---------- EXAMPLE 1 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -AttachDisk $disk
Attach disk $disk to the instance "my-instance" in the default project.
---------- EXAMPLE 2 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -RemoveDisk "my-disk" -Project "my-project"
Remove disk "my-disk" from the instance "my-instance" in the project "my-project". Please note that "my-disk" is
the device name of the disk in the instance, not the persistent name of the disk.
---------- EXAMPLE 3 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -TurnOnAutoDeleteDisk "my-disk"
Turn on autodelete for disk "my-disk" from the instance "my-instance". Please note that "my-disk" is the device
name of the disk in the instance, not the persistent name of the disk.
---------- EXAMPLE 4 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -TurnOffAutoDeleteDisk $disk1, $disk2
Turn off autodelete for disk $disk1 and $disk2 from the instance "my-instance".
RELATED LINKS
[Instance resource definition] (https://cloud.google.com/compute/docs/r ... s#resource)
SYNOPSIS
Sets various attributes of a VM instance.
SYNTAX
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> -NetworkInterface <string> [-AddAccessConfig
<AccessConfig[]>] [-RemoveAccessConfig <string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-AddDisk <object[]>] [-RemoveDisk
<string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-TurnOnAutoDeleteDisk <string[]>]
[-TurnOffAutoDeleteDisk <string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-AddMetadata <Hashtable>] [-RemoveMetadata
<string[]>] [<CommonParameters>]
Set-GceInstance [-Project <string>] [-Zone <string>] [-Name] <string> [-AddTag <string[]>] [-RemoveTag <string[]>]
[<CommonParameters>]
Set-GceInstance [-Object] <Instance> -NetworkInterface <string> [-AddAccessConfig <AccessConfig[]>]
[-RemoveAccessConfig <string[]>] [<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-AddDisk <object[]>] [-RemoveDisk <string[]>] [<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-TurnOnAutoDeleteDisk <string[]>] [-TurnOffAutoDeleteDisk <string[]>]
[<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-AddMetadata <Hashtable>] [-RemoveMetadata <string[]>] [<CommonParameters>]
Set-GceInstance [-Object] <Instance> [-AddTag <string[]>] [-RemoveTag <string[]>] [<CommonParameters>]
DESCRIPTION
With this cmdlet, you can update metadata, attach and detach disks, add and remove access configs, or add and
remove tags.
PARAMETERS
-Project <string>
The project that owns the instance to update.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Zone <string>
The zone in which the instance resides.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <string>
The name of the instance to update.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Object <Instance>
The instance object to update.
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-NetworkInterface <string>
The name of the network interface to add or remove access configs.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AddAccessConfig <AccessConfig[]>
The new access config to add to a network interface.
Required? false
Position? named
Default value Google.Apis.Compute.v1.Data.AccessConfig[]
Accept pipeline input? false
Accept wildcard characters? false
-RemoveAccessConfig <string[]>
The name of the access config to remove from the network interface.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-AddDisk <object[]>
The disk to attach. Can the name of a disk, a disk object from Get-GceDisk, or an attached disk object from
New-GceAttachedDiskConfig.
Required? false
Position? named
Default value System.Object[]
Accept pipeline input? false
Accept wildcard characters? false
-RemoveDisk <string[]>
The name of the disk to detach.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-TurnOnAutoDeleteDisk <string[]>
The names of the disks to turn on autodelete.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-TurnOffAutoDeleteDisk <string[]>
The names of the disks to turn off autodelete.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-AddMetadata <Hashtable>
The keys and values of the metadata to add.
Required? false
Position? named
Default value System.Collections.Hashtable
Accept pipeline input? false
Accept wildcard characters? false
-RemoveMetadata <string[]>
The keys of the metadata to remove.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-AddTag <string[]>
The tag to add.
Required? false
Position? named
Default value System.String[]
Accept pipeline input? false
Accept wildcard characters? false
-RemoveTag <string[]>
The tag to remove.
Required? false
Position? named
Default value System.String[]
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 name of the instance to update.
Google.Apis.Compute.v1.Data.Instance
The instance object to update.
OUTPUTS
Google.Apis.Compute.v1.Data.Instance
---------- EXAMPLE 1 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -AttachDisk $disk
Attach disk $disk to the instance "my-instance" in the default project.
---------- EXAMPLE 2 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -RemoveDisk "my-disk" -Project "my-project"
Remove disk "my-disk" from the instance "my-instance" in the project "my-project". Please note that "my-disk" is
the device name of the disk in the instance, not the persistent name of the disk.
---------- EXAMPLE 3 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -TurnOnAutoDeleteDisk "my-disk"
Turn on autodelete for disk "my-disk" from the instance "my-instance". Please note that "my-disk" is the device
name of the disk in the instance, not the persistent name of the disk.
---------- EXAMPLE 4 ----------
PS C:\\> Set-GceInstance -Name "my-instance" -TurnOffAutoDeleteDisk $disk1, $disk2
Turn off autodelete for disk $disk1 and $disk2 from the instance "my-instance".
RELATED LINKS
[Instance resource definition] (https://cloud.google.com/compute/docs/r ... s#resource)