diff --git a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 index be8f999..17f4919 100644 --- a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 @@ -62,32 +62,20 @@ function Start-ZertoCloneVpg { } } $body['VmIdentifiers'] = $vmIdentifiers - if ($checkpointIdentifier) { - $body['CheckpointIdentifier'] = $checkpointIdentifier - } } - } - - process { - $uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier - $body = [ordered]@{ } if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) { $body['checkpointId'] = $checkpointIdentifier } - if ( $datastoreIdentifier ) { - $body['DatastoreIdentifier'] = $datastoreIdentifier - } - if ( $vmIdentifiers ) { - $body['VmIdentifiers'] = $vmIdentifiers - } Write-Verbose $body + $uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier if ($PSCmdlet.ShouldProcess("Clone Vpg")) { Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST" + Write-Verbose "Call Submitted to $uri" + Write-Verbose "With the following information: $($body | ConvertTo-Json)" } } end { - Write-Verbose "Call Submitted to $uri" - Write-Verbose "With the following information: $($body | ConvertTo-Json)" + } }