Options

PowerShell command to create clones of each current image

RedgateRossRedgateRoss Posts: 5 New member
Hello everyone,

I am currently having a bit of difficutly auotmating the cloning process using the PowerShell Cmdlets. I essentially want to make clones of each image that is currently listed on Redgate, and then deploy them.

My intention was to list all of the live images using Get-SqlCloneImage cmdlet, store the output in a variable and then use a foreach loop in conunction with the Get-SqlClone cmdlet to itterate through and deploy eachclone. However, it doesn't seem to be possible to get a simple list of image names held on the server, without any of the additional metadata that is returned through the cmdlet.

If someone has managed to do this, or something similar, and help/support would be greatly appreciated.

Thanks,
Ross.




Tagged:

Best Answer

  • Options
    ChrisHurleyChrisHurley Posts: 54 Silver 2
    Answer ✓
    Hi Ross,

    If you get all of the images through PowerShell with Get-SqlCloneImage then you should be able to select just the Name properties like this:

    $images = Get-SqlCloneImage
    $imageNames = $images.Name<br>
    The $imageNames variable will then contain the list of image names.

Answers

Sign In or Register to comment.