SQL Clone 4

Wait-SqlCloneOperation

Waits for the completion or failure of a SQL Clone operation.

Syntax

Wait-SqlCloneOperation [-Operation] <OperationResource> [[-TimeoutInSeconds] <int>] [<CommonParameters>]

Description

The Wait-SqlCloneOperation cmdlet waits for the completion or failure of a SQL Clone operation, such as one returned by the New-SqlClone cmdlet.

This cmdlet will return an error if the operation fails or times out.

Connect-SqlClone must be called before this cmdlet.

Parameters

-Operation <RedGate.SqlClone.Client.Api.Objects.OperationResource>

Specifies the SQL Clone operation to wait for.

Aliases None
Required? true
Position? 0
Default Value None
Accept Pipeline Input true (ByValue)
Accept Wildcard Characters false

-TimeoutInSeconds <System.Int32>

Specifies the time to wait, in seconds. If no timeout is specified then the cmdlet will wait until the operation is complete.

If this time is exceeded then an error will be returned.

Aliases None
Required? false
Position? 1
Default Value 0
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.OperationResource

    Specifies the SQL Clone operation to wait for.

Return values

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

  • None

Examples

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

Connect-SqlClone -ServerUrl 'http://sql-clone.example.com:14145'
$Image = Get-SqlCloneImage -Name 'AdventureWorks-20170106110745'
$SqlServerInstance = Get-SqlCloneSqlServerInstance -MachineName WIN201601 -InstanceName SQL2014
$CreationOperation = New-SqlClone -Name 'AdventureWorks-clone1' -Location $SqlServerInstance -Image $Image

Wait-SqlCloneOperation -Operation $CreationOperation

This example waits for the clone creation to complete before returning.

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

$CloneToDelete = Get-SqlClone -Name 'CloneToDelete'
Remove-SqlClone -Clone $CloneToDelete | Wait-SqlCloneOperation

This example uses the pipeline operator to wait for a clone to be deleted.


Didn't find what you were looking for?