Can you retrieve the Image Name from a clone
I have some custom PowerShell that deletes and recreates clones on deployments, but due to the size of some of these, I only want to do this if the latest image has changed from the image that was used for the existing clone. If the same image was already used to created the clone then I just want to reset the clone. This is important to reduce the pipeline deployment times.
I don't seem to be able to get the Image from a clone resource object (RedGate.SqlClone.Client.Api.Objects.CloneResource)
$SqlServerInstance = Get-SqlCloneSqlServerInstance -MachineName "MyServer" -InstanceName ""
$currentClone = Get-SqlClone -Name 'MyDatabase' -Location $SqlServerInstance
Here I would like to be able to use $currentClone.Image.Name or something similar, but I can't see how. I see an option for $currentClone.ParentImageId, however I can't call Get-SqlCloneImage with an Id - I need the name, which is what I'm looking for.
Any ideas for getting the image name from a clone resource?
0 · Share on Twitter