SQL Clone 4

Get-SqlClone

Gets clone details from a SQL Clone Server.

Syntax

Get-SqlClone [[-Name] <string>] [[-Location] <SqlServerInstanceResource>] [[-Image] <ImageResource>] [<CommonParameters>]

Description

The Get-SqlClone cmdlet gets details of clones from a SQL Clone Server.

Without parameters, this cmdlet gets details of all clones. You can specify a particular clone by name, SQL Server instance and/or parent image.

This cmdlet returns a CloneResource which can be passed to the Remove-SqlClone cmdlet to delete a clone.

Connect-SqlClone must be called before this cmdlet.

Parameters

-Name <System.String>

Specifies the name of the clone. Wildcards are permitted.

Aliases None
Required? false
Position? 0
Default Value None
Accept Pipeline Input false
Accept Wildcard Characters false

-Location <RedGate.SqlClone.Client.Api.Objects.SqlServerInstanceResource>

Specifies the server instance that the clone is on. If no location is specified then details of clones on all server instances will be returned.

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

-Image <RedGate.SqlClone.Client.Api.Objects.ImageResource>

Specifies the image that the clone was created from. If no image is specified then details of clones for all parent images will be returned.

Aliases None
Required? false
Position? 2
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.SqlServerInstanceResource

    Specifies the server instance that the clone is on. If no location is specified then details of clones on all server instances will be returned.

  • RedGate.SqlClone.Client.Api.Objects.ImageResource

    Specifies the image that the clone was created from. If no image is specified then details of clones for all parent images will be returned.

Return values

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

  • RedGate.SqlClone.Client.Api.Objects.CloneResource

Examples

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

Get-SqlClone

This command gets details of all clones from a SQL Clone Server.

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

$SqlServerInstance = Get-SqlCloneSqlServerInstance -MachineName TESTMACHINE -InstanceName SQL2014
Get-SqlClone -Name 'ClonedDatabase' -Location $SqlServerInstance

This example gets details of a specific clone named 'CloneDatabase' on 'TESTMACHINE/SQL2014'.

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

$ParentImage = Get-SqlCloneImage -Name 'Example-Image'
Get-SqlClone -Image $ParentImage

This example gets details of all clones based on the image 'Example-Image'.


Didn't find what you were looking for?