exports/Restore-CVVM.ps1


# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.Synopsis
To restore a virtual machine
.Description
To restore a virtual machine
.Example
PS C:\> {{ Add code here }}
 
{{ Add output here }}
.Example
PS C:\> {{ Add code here }}
 
{{ Add output here }}
 
.Inputs
Commvault.Powershell.Models.ICommvaultPowerShellIdentity
.Inputs
Commvault.Powershell.Models.IVMGroupRestoreRequest
.Outputs
Commvault.Powershell.Models.ICreateTaskRespforBackup
.Outputs
Commvault.Powershell.Models.IGenericResp
.Notes
COMPLEX PARAMETER PROPERTIES
 
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
 
AZUREVMINFOLIST <IAzureVMInfo[]>: List of Azure VMs that are to be restored
  [AvailabilityZone <String>]: Azure availablity zones. Defaults to Auto. Values can be as follows: 'Auto' (Select from the source VM config), 'None' (Will not restore to any zone), '{Zone Number}' (Availablity zone number the restored VM should be in. Ex: 2).
  [CreatePublicIP <Boolean?>]: Boolean to specify if VM should have publice IP. Defaults to false.
  [DiskEncryptionSetId <String>]: Azure Disk Encryption Set ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Compute/diskEncryptionSets/{Disk Encryption Set}.
  [DiskEncryptionSetTypeId <String>]: Azure Disk Encryption Type. Values can be: 'EncryptionAtRestWithCustomerKey' or 'EncryptionAtRestWithPlatformAndCustomerKeys' or 'EncryptionAtRestWithPlatformAndCustomerKeys'. For reference: learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.encryptiontype?view=azure-dotnet&viewFallbackFrom=azure-dotnet
  [DiskType <String>]: Disk type to set after restore. Ex: Standard_LRS.
  [Name <String>]: Azure VM name to be set after restore. Defaults to source VM name.
  [Nics <IAzureDestinationInfoNic[]>]: Azure VM network interface list
    [NetworkId <String>]: Azure network ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Network/virtualNetworks/{Network Name}.
    [PrivateIPAddress <String>]: Azure private IP address.
    [PublicIPAddress <String>]: Azure publice IP address.
    [PublicIPAddressId <String>]: Azure public IP address ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Network/publicIPAddresses/{Public IP Address Name}.
    [SubnetId <String>]: Azure subnet ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Network/virtualNetworks/{Network Name}/subnets/{Subnet Name}.
  [Region <String>]: Azure region name. Ex: For azure region (West US 3) the region value will be westus3. For reference: learn.microsoft.com/en-us/rest/api/resources/subscriptions/list-locations
  [ResourceGroup <String>]: Azure Resource Group Name. Defaults to source VM resource group name.
  [RestoreAsManagedVM <Boolean?>]: Boolean to specify if VM need to be restored as managed VM. Defaults to true.
  [SecurityGroupId <String>]: Azure security group to be set for the VM. Defaults to source configuration.
  [SourceVMGuid <String>]: Azure VM ID
  [StorageAccount <String>]: Azure staging storage account. Defaults to source storage account.
  [VMSize <String>]: VM size to be after restore. Defaults to --Auto Select--. Ex: Standard_A1.
  [VMTags <INameValue[]>]: Azure VM tag list
    [Name <String>]:
    [Value <String>]:
 
BODY <IVMGroupRestoreRequest>: VM or VMGroup restore request body
  InPlaceRestore <Boolean>: Flag to set if restore is in-place or out-of-place. Defaults to false.
  [AccessNodeGroupId <Int64?>]:
  [AccessNodeGroupName <String>]:
  [AccessNodeId <Int64?>]:
  [AccessNodeName <String>]:
  [AzureNamePrefix <String>]: Adds prefix for VM display name
  [AzureNameSuffix <String>]: Adds suffix for VM display name
  [AzureVMInfoList <IAzureVMInfo[]>]: List of Azure VMs that are to be restored
    [AvailabilityZone <String>]: Azure availablity zones. Defaults to Auto. Values can be as follows: 'Auto' (Select from the source VM config), 'None' (Will not restore to any zone), '{Zone Number}' (Availablity zone number the restored VM should be in. Ex: 2).
    [CreatePublicIP <Boolean?>]: Boolean to specify if VM should have publice IP. Defaults to false.
    [DiskEncryptionSetId <String>]: Azure Disk Encryption Set ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Compute/diskEncryptionSets/{Disk Encryption Set}.
    [DiskEncryptionSetTypeId <String>]: Azure Disk Encryption Type. Values can be: 'EncryptionAtRestWithCustomerKey' or 'EncryptionAtRestWithPlatformAndCustomerKeys' or 'EncryptionAtRestWithPlatformAndCustomerKeys'. For reference: learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.encryptiontype?view=azure-dotnet&viewFallbackFrom=azure-dotnet
    [DiskType <String>]: Disk type to set after restore. Ex: Standard_LRS.
    [Name <String>]: Azure VM name to be set after restore. Defaults to source VM name.
    [Nics <IAzureDestinationInfoNic[]>]: Azure VM network interface list
      [NetworkId <String>]: Azure network ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Network/virtualNetworks/{Network Name}.
      [PrivateIPAddress <String>]: Azure private IP address.
      [PublicIPAddress <String>]: Azure publice IP address.
      [PublicIPAddressId <String>]: Azure public IP address ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Network/publicIPAddresses/{Public IP Address Name}.
      [SubnetId <String>]: Azure subnet ID. Format: /subscriptions/{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Network/virtualNetworks/{Network Name}/subnets/{Subnet Name}.
    [Region <String>]: Azure region name. Ex: For azure region (West US 3) the region value will be westus3. For reference: learn.microsoft.com/en-us/rest/api/resources/subscriptions/list-locations
    [ResourceGroup <String>]: Azure Resource Group Name. Defaults to source VM resource group name.
    [RestoreAsManagedVM <Boolean?>]: Boolean to specify if VM need to be restored as managed VM. Defaults to true.
    [SecurityGroupId <String>]: Azure security group to be set for the VM. Defaults to source configuration.
    [SourceVMGuid <String>]: Azure VM ID
    [StorageAccount <String>]: Azure staging storage account. Defaults to source storage account.
    [VMSize <String>]: VM size to be after restore. Defaults to --Auto Select--. Ex: Standard_A1.
    [VMTags <INameValue[]>]: Azure VM tag list
      [Name <String>]:
      [Value <String>]:
  [BackupSource <Int64?>]: Backup source information from where you want to restore. 0 (Automatic), 1 (Snap Copy), 2 (Primary), 3 to N (Aux Copy)
  [DestinationId <Int64?>]:
  [DestinationName <String>]:
  [GoogleCloudNamePrefix <String>]: Adds prefix for VM display name
  [GoogleCloudNameSuffix <String>]: Adds suffix for VM display name
  [GoogleCloudVMInfoList <IGoogleCloudVMInfo[]>]: List of Google Cloud VMs that are to be restored
    [CreatePublicIP <Boolean?>]: Flag to create external IP after restore. Defaults to false.
    [CustomMetadata <INameValue[]>]: GCP custom metadata key-value pairs
    [InstanceId <String>]: Instance ID of the google cloud virtual machine to be restored. Ex: 123456789123456789.
    [MachineType <String>]: GCP Machine Family. Ex: c2d-highmem-8. Defaults to --Auto Select--. For Reference: cloud.google.com/compute/docs/machine-resource
    [Name <String>]: The new name of the instance after restore. Defaults to source name after restore.
    [NetworkInterfaces <IGoogleCloudNetworkInterfaceInfo[]>]: Google Cloud VM network interfaces list
      [ExternalIP <String>]: External IP Address. Defaults to null and is not set after restore.
      [InternalIP <String>]: Internal IP address. Defaults to the source internal IP after restore.
      [Name <String>]: Name of the network interface card. Ex: nic0.
      [NetworkId <String>]: Network self-link. Format: googleapis.com/compute/v1/projects/<Project ID>/global/networks/{Network Name}. Defaults to source network self-link.
      [NetworkName <String>]: Network Name. Ex: default. Defaults to source network name.
      [SubnetId <String>]: Subnet self-link. Format: googleapis.com/compute/v1/projects/<Project ID>/regions/<Region>/subnetworks/{Subnet Name}. Defaults to source subnet self-link.
    [NodeAffinities <INameValue[]>]: Node affinity for the virtual machine to provision virtual machine as sole tenanat VM. Defaults to no node affinity. Format: '[{name: compute.googleapis.com/node-group-name, value: {Node Group Name} }, {name: compute.googleapis.com/node-name, value: {Node Name} }]'
    [ProjectId <String>]: GCP Project ID
    [Region <String>]: GCP Region. Ex: asia-east1. Defaults to source instance region after restore. For reference: cloud.google.com/compute/docs/regions-zones#available
    [Zone <String>]: GCP zones. Ex: asia-east1-a. Defaults to source instance zone after restore. For reference: cloud.google.com/compute/docs/regions-zones#available
  [NotifyOnJobCompletion <Boolean?>]: Enable email notificaiton for job status. Defaults to false.
  [OverwriteVM <Boolean?>]: Unconditionally overwrite VM during restore. Defaults to false.
  [PowerOnVMAfterRestore <Boolean?>]: Turn ON virtual machine after restore. Defaults to false.
  [RestoreFlavour <String>]: Type of restore for virtual machine
  [ReuseVMClient <Boolean?>]: Reuse the existing VM client instance of creating new one after restore. Defaults to true for inplace restore and false for out of place restore.
  [TransportMode <String>]: Backup transport modes enum
 
GOOGLECLOUDVMINFOLIST <IGoogleCloudVMInfo[]>: List of Google Cloud VMs that are to be restored
  [CreatePublicIP <Boolean?>]: Flag to create external IP after restore. Defaults to false.
  [CustomMetadata <INameValue[]>]: GCP custom metadata key-value pairs
    [Name <String>]:
    [Value <String>]:
  [InstanceId <String>]: Instance ID of the google cloud virtual machine to be restored. Ex: 123456789123456789.
  [MachineType <String>]: GCP Machine Family. Ex: c2d-highmem-8. Defaults to --Auto Select--. For Reference: cloud.google.com/compute/docs/machine-resource
  [Name <String>]: The new name of the instance after restore. Defaults to source name after restore.
  [NetworkInterfaces <IGoogleCloudNetworkInterfaceInfo[]>]: Google Cloud VM network interfaces list
    [ExternalIP <String>]: External IP Address. Defaults to null and is not set after restore.
    [InternalIP <String>]: Internal IP address. Defaults to the source internal IP after restore.
    [Name <String>]: Name of the network interface card. Ex: nic0.
    [NetworkId <String>]: Network self-link. Format: googleapis.com/compute/v1/projects/<Project ID>/global/networks/{Network Name}. Defaults to source network self-link.
    [NetworkName <String>]: Network Name. Ex: default. Defaults to source network name.
    [SubnetId <String>]: Subnet self-link. Format: googleapis.com/compute/v1/projects/<Project ID>/regions/<Region>/subnetworks/{Subnet Name}. Defaults to source subnet self-link.
  [NodeAffinities <INameValue[]>]: Node affinity for the virtual machine to provision virtual machine as sole tenanat VM. Defaults to no node affinity. Format: '[{name: compute.googleapis.com/node-group-name, value: {Node Group Name} }, {name: compute.googleapis.com/node-name, value: {Node Name} }]'
  [ProjectId <String>]: GCP Project ID
  [Region <String>]: GCP Region. Ex: asia-east1. Defaults to source instance region after restore. For reference: cloud.google.com/compute/docs/regions-zones#available
  [Zone <String>]: GCP zones. Ex: asia-east1-a. Defaults to source instance zone after restore. For reference: cloud.google.com/compute/docs/regions-zones#available
 
INPUTOBJECT <ICommvaultPowerShellIdentity>: Identity Parameter
  [AccessPathId <Int64?>]: Id of the mount path whose access path has to be deleted
  [AgentId <Int64?>]: Id of the agent to be modified
  [AppGuid <String>]: GUID of the Application to get details
  [AppId <Int64?>]: Commvault exchange app id
  [ApplicationGroupId <Int64?>]: applicationGroupId is the ID of the Kubernetes application group
  [ArrayId <Int64?>]:
  [AssetId <String>]: FQDN of the asset
  [BackupDestinationId <Int64?>]: Id of the backupDestination to be modified
  [BackupDestionationId <Int64?>]:
  [BackupLocationId <Int64?>]: Id of the backup location whose details have to be fetched
  [BlackoutWindowId <Int64?>]: Id of the Blackout Window whose details have to be fetched
  [BucketId <Int64?>]: Id of Bucket
  [ClientId <Int64?>]:
  [CloneId <Int64?>]: ID of the cloned bucket
  [CloudStorageId <Int64?>]: Id of cloud Storage
  [ClusterId <Int64?>]: Id of the cluster whose modifier has to be listed.
  [CompanyId <Int64?>]: Id of the Company whose details have to be fetched
  [CopyId <Int64?>]:
  [CredentialId <String>]:
  [CredentialName <String>]:
  [DomainId <Int64?>]: ID of the AD/LDAP domain
  [DrOperation <String>]: Name of DR operation. Case insensitive
  [DriveId <Int64?>]: Id of the Drive of which the drive details has to be displayed
  [EntityId <Int64?>]: Recovery entity Id
  [EntityType <String>]: Type of the entity
  [FailoverGroupId <Int64?>]: Id of the failover group
  [GlobalSearchEntity <String>]: name of global search entity
  [HfsShareId <Int64?>]: Id of the HFS Share to fetch its status
  [HyperScaleStorageId <Int64?>]: Id of hyperscale storage
  [HypervisorId <Int64?>]: Id of the HYpervisor to get
  [Id <Int64?>]:
  [IndexServerClientId <Int64?>]: Pseudo client id of the index server
  [InstanceId <Int64?>]: Id of the instance to modify
  [InventoryId <Int64?>]: Inventory id
  [JobId <Int64?>]:
  [KmsId <Int64?>]: Id of Key Management Server
  [LibraryId <Int64?>]: Id of the library to view the data
  [MediaAgentId <Int64?>]: Id of the Media Agent whose details have to be fetched
  [MetadataCacheId <Int64?>]: Id of metadata cache
  [ModifierName <String>]: Name of the modifier to be read.
  [Name <String>]:
  [NameSpace <String>]: Name of the namespace to browse for content
  [NodeId <Int64?>]: Id of node
  [PairId <Int64?>]:
  [PlanId <Int64?>]: Id of the object store plan to fetch details
  [RecoveryGroupId <Int64?>]: Recovery group Id
  [RecoveryTargetId <Int64?>]: id of recovery target
  [RegionId <Int64?>]: Region id to be deleted.
  [RegionList <String>]: List of region names/ids to be deleted. If region ids are passed, set isRegionIdList=true
  [ReplicationGroupId <Int64?>]:
  [RequestId <Int64?>]: Unique identifier for the request
  [RoleId <Int64?>]: Role Id
  [RpsId <String>]:
  [RuleId <Int64?>]: Id of the rule to update in Plan
  [ScheduleId <Int64?>]: ID of the DR operation schedule
  [SchedulePolicyId <Int64?>]:
  [ServerGroupId <Int64?>]: Id of the serverGroupId whose details have to be fetched
  [ServerId <Int64?>]: Id of the server to modify
  [StoragePoolId <Int64?>]: Id of the storage pool whose associated copies have to be fetched
  [SubclientId <Int64?>]: Id of the subclient to modify
  [TagId <Int64?>]: Id of the tag to delete
  [TagValue <String>]: tag value to delete
  [TopologyId <String>]:
  [UserGroupId <Int64?>]: Id of the user-group whose details have to be fetched
  [UserId <Int64?>]: Id of the User whose details have to be fetched
  [VMGroupId <Int64?>]: Id of the VMgroup to update
  [VMGuid <String>]:
  [VMUuid <String>]: The vmUUID can be obtained from GET /virtualMachines UUID property
  [VendorId <Int64?>]:
.Link
https://docs.microsoft.com/en-us/powershell/module/commvaultpowershell/restore-cvvm
#>

function Restore-CVVM {
[OutputType([Commvault.Powershell.Models.ICreateTaskRespforBackup], [Commvault.Powershell.Models.IGenericResp])]
[CmdletBinding(DefaultParameterSetName='RestoreExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
    [Parameter(ParameterSetName='Restore', Mandatory)]
    [Parameter(ParameterSetName='RestoreExpanded', Mandatory)]
    [Commvault.Powershell.Category('Path')]
    [System.String]
    # .
    ${VMGuid},

    [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)]
    [Commvault.Powershell.Category('Path')]
    [Commvault.Powershell.Models.ICommvaultPowerShellIdentity]
    # Identity Parameter
    # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
    ${InputObject},

    [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)]
    [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)]
    [Commvault.Powershell.Category('Body')]
    [Commvault.Powershell.Models.IVMGroupRestoreRequest]
    # VM or VMGroup restore request body
    # To construct, see NOTES section for BODY properties and create a hash table.
    ${Body},

    [Parameter(ParameterSetName='RestoreExpanded', Mandatory)]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)]
    [Commvault.Powershell.Category('Body')]
    [System.Management.Automation.SwitchParameter]
    # Flag to set if restore is in-place or out-of-place.
    # Defaults to false.
    ${InPlaceRestore},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Int64]
    # .
    ${AccessNodeGroupId},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # .
    ${AccessNodeGroupName},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Int64]
    # .
    ${AccessNodeId},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # .
    ${AccessNodeName},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Adds prefix for VM display name
    ${AzureNamePrefix},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Adds suffix for VM display name
    ${AzureNameSuffix},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [Commvault.Powershell.Models.IAzureVMInfo[]]
    # List of Azure VMs that are to be restored
    # To construct, see NOTES section for AZUREVMINFOLIST properties and create a hash table.
    ${AzureVMInfoList},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Int64]
    # Backup source information from where you want to restore.
    # 0 (Automatic), 1 (Snap Copy), 2 (Primary), 3 to N (Aux Copy)
    ${BackupSource},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Int64]
    # .
    ${DestinationId},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # .
    ${DestinationName},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Adds prefix for VM display name
    ${GoogleCloudNamePrefix},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Adds suffix for VM display name
    ${GoogleCloudNameSuffix},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [Commvault.Powershell.Models.IGoogleCloudVMInfo[]]
    # List of Google Cloud VMs that are to be restored
    # To construct, see NOTES section for GOOGLECLOUDVMINFOLIST properties and create a hash table.
    ${GoogleCloudVMInfoList},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Management.Automation.SwitchParameter]
    # Enable email notificaiton for job status.
    # Defaults to false.
    ${NotifyOnJobCompletion},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Management.Automation.SwitchParameter]
    # Unconditionally overwrite VM during restore.
    # Defaults to false.
    ${OverwriteVM},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Management.Automation.SwitchParameter]
    # Turn ON virtual machine after restore.
    # Defaults to false.
    ${PowerOnVMAfterRestore},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Type of restore for virtual machine
    ${RestoreFlavour},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.Management.Automation.SwitchParameter]
    # Reuse the existing VM client instance of creating new one after restore.
    # Defaults to true for inplace restore and false for out of place restore.
    ${ReuseVMClient},

    [Parameter(ParameterSetName='RestoreExpanded')]
    [Parameter(ParameterSetName='RestoreViaIdentityExpanded')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Backup transport modes enum
    ${TransportMode},

    [Parameter(DontShow)]
    [Commvault.Powershell.Category('Runtime')]
    [System.Management.Automation.SwitchParameter]
    # Wait for .NET debugger to attach
    ${Break},

    [Parameter(DontShow)]
    [ValidateNotNull()]
    [Commvault.Powershell.Category('Runtime')]
    [Commvault.Powershell.Runtime.SendAsyncStep[]]
    # SendAsync Pipeline Steps to be appended to the front of the pipeline
    ${HttpPipelineAppend},

    [Parameter(DontShow)]
    [ValidateNotNull()]
    [Commvault.Powershell.Category('Runtime')]
    [Commvault.Powershell.Runtime.SendAsyncStep[]]
    # SendAsync Pipeline Steps to be prepended to the front of the pipeline
    ${HttpPipelinePrepend},

    [Parameter(DontShow)]
    [Commvault.Powershell.Category('Runtime')]
    [System.Uri]
    # The URI for the proxy server to use
    ${Proxy},

    [Parameter(DontShow)]
    [ValidateNotNull()]
    [Commvault.Powershell.Category('Runtime')]
    [System.Management.Automation.PSCredential]
    # Credentials for a proxy server to use for the remote call
    ${ProxyCredential},

    [Parameter(DontShow)]
    [Commvault.Powershell.Category('Runtime')]
    [System.Management.Automation.SwitchParameter]
    # Use the default credentials for the proxy
    ${ProxyUseDefaultCredentials}
)

begin {
    try {
        $outBuffer = $null
        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
            $PSBoundParameters['OutBuffer'] = 1
        }
        $parameterSet = $PSCmdlet.ParameterSetName
        $mapping = @{
            Restore = 'CommvaultPowershell.private\Restore-CVVM_Restore';
            RestoreExpanded = 'CommvaultPowershell.private\Restore-CVVM_RestoreExpanded';
            RestoreViaIdentity = 'CommvaultPowershell.private\Restore-CVVM_RestoreViaIdentity';
            RestoreViaIdentityExpanded = 'CommvaultPowershell.private\Restore-CVVM_RestoreViaIdentityExpanded';
        }
        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
        $scriptCmd = {& $wrappedCmd @PSBoundParameters}
        $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
        $steppablePipeline.Begin($PSCmdlet)
    } catch {
        throw
    }
}

process {
    try {
        $steppablePipeline.Process($_)
    } catch {
        throw
    }
}

end {
    try {
        $steppablePipeline.End()
    } catch {
        throw
    }
}
}