Remove-SqlCloneMachine
Published 11 October 2017
Removes a machine registered with SQL Clone.
Syntax
Remove-SqlCloneMachine [-Machine] <AgentResource> [-Force] [<CommonParameters>]
Description
The Remove-SqlCloneMachine cmdlet dissociates an agent machine from a SQL Clone Server.
Any clones or images created using this machine must be deleted, and the SQL Clone Agent must be offline, before the machine can be removed.
If the machine no longer exists, you can use the -Force parameter to remove the machine from SQL Clone even though there were still clones on the machine.
Connect-SqlClone must be called before this cmdlet.
Parameters
-Machine
<RedGate.SqlClone.Client.Api.Objects.AgentResource>
Specifies a machine to remove. The Get-SqlCloneMachine cmdlet can be used to get an AgentResource.
Aliases | None |
Required? | true |
Position? | 0 |
Default Value | None |
Accept Pipeline Input | true (ByValue) |
Accept Wildcard Characters | false |
-Force
<System.Management.Automation.SwitchParameter>
Remove the machine even if it still has clones. This must only be used if the machine no longer exists; if the machine still exists, delete the clones first and then remove the machine without -Force.
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.AgentResource
Specifies a machine to remove. The Get-SqlCloneMachine cmdlet can be used to get an AgentResource.
Return values
The output type is the type of the objects that the cmdlet emits.
- RedGate.SqlClone.Client.Api.Objects.OperationResource
Examples
---------- EXAMPLE 1 ----------
$AgentToDelete = Get-SqlCloneMachine -Name 'machine-name' Remove-SqlCloneMachine -Machine $AgentToDelete
This example removes the machine 'machine-name' from SQL Clone.