Remove-SqlCloneImage
Published 24 February 2017
Starts deleting an image.
Syntax
Remove-SqlCloneImage [-Image] <ImageResource> [-Soft] [<CommonParameters>]
Description
The Remove-SqlCloneImage cmdlet starts deleting a SQL Clone image and outputs details of the deletion operation.
This cmdlet returns a OperationResource which can be passed to the Wait-SqlCloneOperation cmdlet.
Any clones of the image must be deleted before the image can be deleted.
Connect-SqlClone must be called before this cmdlet.
Parameters
-Image
<RedGate.SqlClone.Client.Api.Objects.ImageResource>
Specifies the image to delete. The Get-SqlCloneImage cmdlet can be used to get an ImageResource.
Aliases | None |
Required? | true |
Position? | 0 |
Default Value | None |
Accept Pipeline Input | true (ByValue) |
Accept Wildcard Characters | false |
-Soft
<System.Management.Automation.SwitchParameter>
Specifies that the image should be removed from SQL Clone without deleting the underlying image files. This can be useful if the image cannot be deleted normally because the agent that created it is no longer in use.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
RedGate.SqlClone.Client.Api.Objects.ImageResource
Specifies the image to delete. The Get-SqlCloneImage cmdlet can be used to get an ImageResource.
Return values
The output type is the type of the objects that the cmdlet emits.
- RedGate.SqlClone.Client.Api.Objects.OperationResource
Examples
---------- EXAMPLE 1 ----------
$ImageToDelete = Get-SqlCloneImage -Name 'ImageToDelete' Remove-SqlCloneImage -Image $ImageToDelete
This example deletes an image with the name 'ImageToDelete'.
---------- EXAMPLE 2 ----------
Get-SqlCloneImage -Name 'ImageToDelete' | Remove-SqlCloneImage | Wait-SqlCloneOperation
This example uses the pipeline operator to delete the image 'ImageToDelete' and waits for the operation to complete before returning.