I`m following the documentation: https://googlecloudplatform.github.io/google-cloud-powershell/#/google-compute-engine/GceInstance/Set-GceInstance
I cant get the following code working:
$disk = Get-GceDisk disk-snapshot-instance-1
Set-GceInstance -Name instance-1 -AttachDisk $disk
When I replace $disk for disk-snapshot-instance-1 I get the same error:
Set-GceInstance : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Set-GceInstance -Name instance-1 -AttachDisk $disk
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-GceInstance], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Google.PowerShell.ComputeEngine.SetGceInstanceCmdlet
The thing I don't understand is that it works for me to remove a disk when attaching it manually through the G-cloud interface.
Set-GceInstance -Name instance-1 -RemoveDisk $disk
My question: Why can't I attach a disk to an instance with the above code, while removing the disk works?
Get-GceDiskto set$diskbefore the remove too? - DazWilkin