internal void ExecuteCommand()
        {
            ServiceManagementProfile.Initialize();

            var walkUpgradeDomainParams = new DeploymentWalkUpgradeDomainParameters
            {
                UpgradeDomain = this.DomainNumber
            };

            DeploymentSlot slotType = (DeploymentSlot)Enum.Parse(typeof(DeploymentSlot), Slot, true);

            ExecuteClientActionNewSM(
                null,
                CommandRuntime.ToString(),
                () => this.ComputeClient.Deployments.WalkUpgradeDomainByDeploymentSlot(ServiceName, slotType, walkUpgradeDomainParams));
        }
 /// <summary>
 /// The Walk Upgrade Domain By Deployment Slot operation specifies an
 /// update domain in which a role instance must be updated. For more
 /// information about updating role instances, see Update an Azure
 /// Service at
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh472157.aspx.
 /// This operation is an asynchronous operation. To determine whether
 /// the Management service has finished processing the request, call
 /// Get Operation Status. For more information on asynchronous
 /// operations, see Tracking Asynchronous Service Management Requests
 /// at
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460791.aspx.
 /// Prior to calling the Walk Upgrade Domain operation you must have
 /// called Upgrade Deployment, Change Deployment Configuration, or
 /// Rollback Update Or Upgrade. By default, a service is deployed with
 /// five update domains, which are updated one at a time during an
 /// in-place update. For information on modifying the number of update
 /// domains in the service definition file, see the Azure Service
 /// Definition Schema (.csdef File). To perform a manual update of
 /// your deployment, proceed in this order: Call Upgrade Deployment
 /// with the Mode element set to manual. Call Walk Upgrade Domain to
 /// update each domain within the deployment. Update domains must be
 /// updated in order. For example, begin with domain 0, proceed to
 /// domain 1, and so on. Important: An update that adds or removes
 /// role instances will result in a configuration update to all roles
 /// that are deployed in the cloud service. Existing role instances
 /// need to be notified of new role instances so that all role
 /// instances can communicate together in the cloud service. While an
 /// update is in progress, call Get Deployment to determine its
 /// status. If the update is in progress, Get Deployment returns an
 /// UpgradeStatus element that contains information about the update.
 /// If the update is complete, or if no update is in progress, then
 /// the UpgradeStatus element is null.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460800.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='deploymentSlot'>
 /// Required. The deployment slot.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Walk Upgrade Domain By
 /// Deployment Slot operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task<OperationStatusResponse> WalkUpgradeDomainByDeploymentSlotAsync(this IDeploymentOperations operations, string serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters)
 {
     return operations.WalkUpgradeDomainByDeploymentSlotAsync(serviceName, deploymentSlot, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Walk Upgrade Domain By Deployment Slot operation specifies an
 /// update domain in which a role instance must be updated. For more
 /// information about updating role instances, see Update an Azure
 /// Service at
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh472157.aspx.
 /// This operation is an asynchronous operation. To determine whether
 /// the Management service has finished processing the request, call
 /// Get Operation Status. For more information on asynchronous
 /// operations, see Tracking Asynchronous Service Management Requests
 /// at
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460791.aspx.
 /// Prior to calling the Walk Upgrade Domain operation you must have
 /// called Upgrade Deployment, Change Deployment Configuration, or
 /// Rollback Update Or Upgrade. By default, a service is deployed with
 /// five update domains, which are updated one at a time during an
 /// in-place update. For information on modifying the number of update
 /// domains in the service definition file, see the Azure Service
 /// Definition Schema (.csdef File). To perform a manual update of
 /// your deployment, proceed in this order: Call Upgrade Deployment
 /// with the Mode element set to manual. Call Walk Upgrade Domain to
 /// update each domain within the deployment. Update domains must be
 /// updated in order. For example, begin with domain 0, proceed to
 /// domain 1, and so on. Important: An update that adds or removes
 /// role instances will result in a configuration update to all roles
 /// that are deployed in the cloud service. Existing role instances
 /// need to be notified of new role instances so that all role
 /// instances can communicate together in the cloud service. While an
 /// update is in progress, call Get Deployment to determine its
 /// status. If the update is in progress, Get Deployment returns an
 /// UpgradeStatus element that contains information about the update.
 /// If the update is complete, or if no update is in progress, then
 /// the UpgradeStatus element is null.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460800.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='deploymentSlot'>
 /// Required. The deployment slot.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Walk Upgrade Domain By
 /// Deployment Slot operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static OperationStatusResponse WalkUpgradeDomainByDeploymentSlot(this IDeploymentOperations operations, string serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IDeploymentOperations)s).WalkUpgradeDomainByDeploymentSlotAsync(serviceName, deploymentSlot, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// The Begin Walking Upgrade Domain By Deployment Name operation
 /// specifies an update domain in which a role instance must be
 /// updated. For more information about updating role instances, see
 /// Update an Azure Service at
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh472157.aspx.
 /// This operation is an asynchronous operation. To determine whether
 /// the Management service has finished processing the request, call
 /// Get Operation Status. For more information on asynchronous
 /// operations, see Tracking Asynchronous Service Management Requests
 /// at
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460791.aspx.
 /// Prior to calling the Walk Upgrade Domain operation you must have
 /// called Upgrade Deployment, Change Deployment Configuration, or
 /// Rollback Update Or Upgrade. By default, a service is deployed with
 /// five update domains, which are updated one at a time during an
 /// in-place update. For information on modifying the number of update
 /// domains in the service definition file, see the Azure Service
 /// Definition Schema (.csdef File). To perform a manual update of
 /// your deployment, proceed in this order: Call Upgrade Deployment
 /// with the Mode element set to manual. Call Walk Upgrade Domain to
 /// update each domain within the deployment. Update domains must be
 /// updated in order. For example, begin with domain 0, proceed to
 /// domain 1, and so on. Important: An update that adds or removes
 /// role instances will result in a configuration update to all roles
 /// that are deployed in the cloud service. Existing role instances
 /// need to be notified of new role instances so that all role
 /// instances can communicate together in the cloud service. While an
 /// update is in progress, call Get Deployment to determine its
 /// status. If the update is in progress, Get Deployment returns an
 /// UpgradeStatus element that contains information about the update.
 /// If the update is complete, or if no update is in progress, then
 /// the UpgradeStatus element is null.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460800.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of your deployment.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Begin Walking Upgrade Domain
 /// By Deployment Name operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<AzureOperationResponse> BeginWalkingUpgradeDomainByDeploymentNameAsync(this IDeploymentOperations operations, string serviceName, string deploymentName, DeploymentWalkUpgradeDomainParameters parameters)
 {
     return operations.BeginWalkingUpgradeDomainByDeploymentNameAsync(serviceName, deploymentName, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Walk Upgrade Domain operation specifies an update domain in
 /// which a role instance must be updated. For more information about
 /// updating role instances, see Update a Windows Azure Service.  The
 /// Walk Upgrade Domain operation is an asynchronous operation. To
 /// determine whether the Management service has finished processing
 /// the request, call Get Operation Status.  For more information on
 /// asynchronous operations, see Tracking Asynchronous Service
 /// Management Requests.  Prior to calling the Walk Upgrade Domain
 /// operation you must have called Upgrade Deployment, Change
 /// Deployment Configuration, or Rollback Update Or Upgrade.  By
 /// default, a service is deployed with five update domains, which are
 /// updated one at a time during an in-place update. For information
 /// on modifying the number of update domains in the service
 /// definition file, see Windows Azure Service Definition Schema
 /// (.csdef File).  To perform a manual update of your deployment,
 /// proceed in this order:  Call Upgrade Deployment with the Mode
 /// element set to manual.   Call Walk Upgrade Domain to update each
 /// domain within the deployment. Update domains must be updated in
 /// order. For example, begin with domain 0, proceed to domain 1, and
 /// so on.  Important: An update that adds or removes role instances
 /// will result in a configuration update to all roles that are
 /// deployed in the cloud service. Existing role instances need to be
 /// notified of new role instances so that all role instances can
 /// communicate together in the cloud service.  While an update is in
 /// progress, call Get Deployment to determine its status. If the
 /// update is in progress, Get Deployment returns an UpgradeStatus
 /// element that contains information about the update. If the update
 /// is complete, or if no update is in progress, then the
 /// UpgradeStatus element is null.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460800.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the cloud service.
 /// </param>
 /// <param name='deploymentSlot'>
 /// The deployment slot.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Walk Upgrade Domain operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself.  If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request.  If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static ComputeOperationStatusResponse WalkUpgradeDomainByDeploymentSlot(this IDeploymentOperations operations, string serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters)
 {
     try
     {
         return operations.WalkUpgradeDomainByDeploymentSlotAsync(serviceName, deploymentSlot, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Walk Upgrade Domain operation specifies an update domain in
 /// which a role instance must be updated. For more information about
 /// updating role instances, see Update a Windows Azure Service.  The
 /// Walk Upgrade Domain operation is an asynchronous operation. To
 /// determine whether the Management service has finished processing
 /// the request, call Get Operation Status.  For more information on
 /// asynchronous operations, see Tracking Asynchronous Service
 /// Management Requests.  Prior to calling the Walk Upgrade Domain
 /// operation you must have called Upgrade Deployment, Change
 /// Deployment Configuration, or Rollback Update Or Upgrade.  By
 /// default, a service is deployed with five update domains, which are
 /// updated one at a time during an in-place update. For information
 /// on modifying the number of update domains in the service
 /// definition file, see Windows Azure Service Definition Schema
 /// (.csdef File).  To perform a manual update of your deployment,
 /// proceed in this order:  Call Upgrade Deployment with the Mode
 /// element set to manual.   Call Walk Upgrade Domain to update each
 /// domain within the deployment. Update domains must be updated in
 /// order. For example, begin with domain 0, proceed to domain 1, and
 /// so on.  Important: An update that adds or removes role instances
 /// will result in a configuration update to all roles that are
 /// deployed in the cloud service. Existing role instances need to be
 /// notified of new role instances so that all role instances can
 /// communicate together in the cloud service.  While an update is in
 /// progress, call Get Deployment to determine its status. If the
 /// update is in progress, Get Deployment returns an UpgradeStatus
 /// element that contains information about the update. If the update
 /// is complete, or if no update is in progress, then the
 /// UpgradeStatus element is null.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460800.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the cloud service.
 /// </param>
 /// <param name='deploymentName'>
 /// The name of your deployment.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Walk Upgrade Domain operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse BeginWalkingUpgradeDomainByDeploymentName(this IDeploymentOperations operations, string serviceName, string deploymentName, DeploymentWalkUpgradeDomainParameters parameters)
 {
     try
     {
         return operations.BeginWalkingUpgradeDomainByDeploymentNameAsync(serviceName, deploymentName, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
        protected PSArgument[] CreateDeploymentWalkUpgradeDomainByDeploymentSlotParameters()
        {
            string serviceName = string.Empty;
            DeploymentSlot deploymentSlot = new DeploymentSlot();
            DeploymentWalkUpgradeDomainParameters parameters = new DeploymentWalkUpgradeDomainParameters();

            return ConvertFromObjectsToArguments(new string[] { "ServiceName", "DeploymentSlot", "Parameters" }, new object[] { serviceName, deploymentSlot, parameters });
        }