SQL Clone 4

Remove-SqlClone

Starts deleting a clone.

Syntax

Remove-SqlClone [-Clone] <CloneResource> [<CommonParameters>]

Description

The Remove-SqlClone cmdlet starts deleting a clone and outputs details of the deletion operation.

This cmdlet returns a OperationResource which can be passed to the Wait-SqlCloneOperation cmdlet.

Connect-SqlClone must be called before this cmdlet.

Parameters

-Clone <RedGate.SqlClone.Client.Api.Objects.CloneResource>

Specifies the clone to delete. The Get-SqlClone cmdlet can be used to get a CloneResource.

Aliases None
Required? true
Position? 0
Default Value None
Accept Pipeline Input true (ByValue)
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.CloneResource

    Specifies the clone to delete. The Get-SqlClone cmdlet can be used to get a CloneResource.

Return values

The output type is the type of the objects that the cmdlet emits.

  • RedGate.SqlClone.Client.Api.Objects.OperationResource

Examples

---------- EXAMPLE 1 ----------

$SqlServerInstance = Get-SqlCloneSqlServerInstance -MachineName TESTMACHINE -InstanceName SQL2014
$CloneToDelete = Get-SqlClone -Name 'CloneToDelete' -Location $SqlServerInstance
Remove-SqlClone -Clone $CloneToDelete

This example deletes the clone with the name 'CloneToDelete' on the SQL Server TESTMACHINE\SQL2014.

---------- EXAMPLE 2 ----------

Get-SqlClone -Name 'CloneToDelete' | Remove-SqlClone | Wait-SqlCloneOperation

This example uses the pipeline to deletes an clones with the name 'CloneToDelete' and waits for the operation to finish before returning.

---------- EXAMPLE 3 ----------

Connect-SqlClone -ServerUrl 'http://sql-clone.example.com:14145'
$ClonesToDelete = Get-SqlClone -Name 'Dev-*'
$ClonesToDelete | Remove-SqlClone | Wait-SqlCloneOperation

This example deletes all clones with the name prefix 'Dev-' and waits for the operations to complete.


Didn't find what you were looking for?