Reset-SqlClone
Published 02 August 2018
Resets a clone to its initial state.
Syntax
Reset-SqlClone [-Clone] <CloneResource> [<CommonParameters>]
Description
The Reset-SqlClone cmdlet starts resetting a clone and outputs details of the reset 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 reset. 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 reset. 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 $CloneToReset = Get-SqlClone -Name 'CloneToReset' -Location $SqlServerInstance Reset-SqlClone -Clone $CloneToReset
This example resets the clone with the name 'CloneToReset' on the SQL Server TESTMACHINE\SQL2014.
---------- EXAMPLE 2 ----------
Get-SqlClone -Name 'CloneToReset' | Reset-SqlClone | Wait-SqlCloneOperation
This example uses the pipeline to reset the clone named 'CloneToReset' and waits for the operation to finish before returning.
---------- EXAMPLE 3 ----------
Connect-SqlClone -ServerUrl 'http://sql-clone.example.com:14145' $ClonesToReset = Get-SqlClone -Name 'Dev-*' $ClonesToReset | Reset-SqlClone | Wait-SqlCloneOperation
This example resets all clones with the name prefix 'Dev-' and waits for the operations to complete.