/// <summary>
        /// Executes the cmdlet
        /// </summary>
        private void RunCmdlet()
        {
            var resourceIdsToUse = this.resourceIds
                .Concat(this.ResourceId)
                .DistinctArray(StringComparer.InvariantCultureIgnoreCase);

            this.DestinationSubscriptionId = this.Profile.Context.Subscription.Id;

            var resourceGroup = ResourceIdUtility.GetResourceId(
                subscriptionId: this.DestinationSubscriptionId,
                resourceGroupName: this.DestinationResourceGroupName,
                resourceName: null,
                resourceType: null);

            this.ConfirmAction(
                this.Force,
                string.Format(
                    "Are you sure you want to move these resources to the resource group '{0}' the resources: {1}",
                    resourceGroup,
                    Environment.NewLine.AsArray().Concat(resourceIdsToUse).ConcatStrings(Environment.NewLine)),
                "Moving the resources.",
                resourceGroup,
                () =>
                {
                    var apiVersion = this
                        .DetermineApiVersion(
                            providerNamespace: Constants.MicrosoftResourceNamesapce,
                            resourceType: Constants.ResourceGroups)
                        .Result;

                    var parameters = new ResourceBatchMoveParameters
                    {
                        Resources = resourceIdsToUse,
                        TargetResourceGroup = resourceGroup,
                    };

                    var operationResult = this.GetResourcesClient()
                        .InvokeActionOnResource<JObject>(
                            resourceId: resourceGroup,
                            action: Constants.Move,
                            apiVersion: apiVersion,
                            parameters: parameters.ToJToken(),
                            cancellationToken: this.CancellationToken.Value)
                        .Result;

                    var managementUri = this.GetResourcesClient()
                        .GetResourceManagementRequestUri(
                            resourceId: resourceGroup,
                            apiVersion: apiVersion,
                            action: Constants.Move);

                    var activity = string.Format("POST {0}", managementUri.PathAndQuery);

                    var result = this
                        .GetLongRunningOperationTracker(
                            activityName: activity,
                            isResourceCreateOrUpdate: false)
                        .WaitOnOperation(operationResult: operationResult);

                    this.WriteObject(result);
                });
        }
        /// <summary>
        /// Executes the cmdlet
        /// </summary>
        private void RunCmdlet()
        {
            var resourceIdsToUse = this.resourceIds
                .Concat(this.ResourceId)
                .DistinctArray(StringComparer.InvariantCultureIgnoreCase);

            this.DestinationSubscriptionId = this.DestinationSubscriptionId ?? this.Profile.Context.Subscription.Id;

            var sourceResourceGroups = resourceIdsToUse
                .Select(resourceId => ResourceIdUtility.GetResourceGroupId(resourceId))
                .Where(resourceGroupId => !string.IsNullOrWhiteSpace(resourceGroupId))
                .DistinctArray(StringComparer.InvariantCultureIgnoreCase);

            var sourceResourceGroup = sourceResourceGroups.SingleOrDefault();

            if (sourceResourceGroup == null)
            {
                throw new InvalidOperationException(
                    string.Format("The resources being moved must all reside in the same resource group. The resources: {0}", resourceIdsToUse.ConcatStrings(", ")));
            }

            var destinationResourceGroup = ResourceIdUtility.GetResourceId(
                subscriptionId: this.DestinationSubscriptionId,
                resourceGroupName: this.DestinationResourceGroupName,
                resourceName: null,
                resourceType: null);

            this.ConfirmAction(
                this.Force,
                string.Format(
                    "Are you sure you want to move these resources to the resource group '{0}' the resources: {1}",
                    destinationResourceGroup,
                    Environment.NewLine.AsArray().Concat(resourceIdsToUse).ConcatStrings(Environment.NewLine)),
                "Moving the resources.",
                destinationResourceGroup,
                () =>
                {
                    var apiVersion = this
                        .DetermineApiVersion(
                            providerNamespace: Constants.MicrosoftResourceNamesapce,
                            resourceType: Constants.ResourceGroups)
                        .Result;

                    var parameters = new ResourceBatchMoveParameters
                    {
                        Resources = resourceIdsToUse,
                        TargetResourceGroup = destinationResourceGroup,
                    };

                    var operationResult = this.GetResourcesClient()
                        .InvokeActionOnResource<JObject>(
                            resourceId: sourceResourceGroup,
                            action: Constants.MoveResources,
                            apiVersion: apiVersion,
                            parameters: parameters.ToJToken(),
                            cancellationToken: this.CancellationToken.Value)
                        .Result;

                    if(!this.NoWait)
                    {
                        var managementUri = this.GetResourcesClient()
                        .GetResourceManagementRequestUri(
                            resourceId: destinationResourceGroup,
                            apiVersion: apiVersion,
                            action: Constants.MoveResources);

                        var activity = string.Format("POST {0}", managementUri.PathAndQuery);

                        var result = this
                            .GetLongRunningOperationTracker(
                                activityName: activity,
                                isResourceCreateOrUpdate: false)
                            .WaitOnOperation(operationResult: operationResult);

                        this.TryConvertAndWriteObject(result, ResourceObjectFormat.New);
                    }
                    else
                    {
                        this.WriteObject(operationResult);
                    }
                });
        }