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

            var parameters = new AffinityGroupUpdateParameters
            {
                Label = this.Label,
                Description = this.Description ?? null
            };
            ExecuteClientActionNewSM(null, CommandRuntime.ToString(), () => this.ManagementClient.AffinityGroups.Update(this.Name, parameters));
        }
 /// <summary>
 ///     Update affinity group
 /// </summary>
 /// <param name="name"></param>
 /// <param name="input"></param>
 public void UpdateAffinityGroup(string name, AffinityGroupUpdateParameters input)
 {
     TestEasyLog.Instance.Info(string.Format("Updating affinity group '{0}'", name));
     ManagementClient.AffinityGroups.UpdateAsync(name, input, new CancellationToken()).Wait();
 }
 /// <summary>
 /// The Update Affinity Group operation updates the label and/or the
 /// description for an affinity group for the specified subscription.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715316.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.IAffinityGroupOperations.
 /// </param>
 /// <param name='affinityGroupName'>
 /// The name of your affinity group.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Affinity Group operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<OperationResponse> UpdateAsync(this IAffinityGroupOperations operations, string affinityGroupName, AffinityGroupUpdateParameters parameters)
 {
     return operations.UpdateAsync(affinityGroupName, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Update Affinity Group operation updates the label and/or the
 /// description for an affinity group for the specified subscription.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715316.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.IAffinityGroupOperations.
 /// </param>
 /// <param name='affinityGroupName'>
 /// The name of your affinity group.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Affinity Group operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse Update(this IAffinityGroupOperations operations, string affinityGroupName, AffinityGroupUpdateParameters parameters)
 {
     try
     {
         return operations.UpdateAsync(affinityGroupName, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Update Affinity Group operation updates the label and/or the
 /// description for an affinity group for the specified subscription.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715316.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.IAffinityGroupOperations.
 /// </param>
 /// <param name='affinityGroupName'>
 /// Required. The name of the affinity group.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Update Affinity Group
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Update(this IAffinityGroupOperations operations, string affinityGroupName, AffinityGroupUpdateParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IAffinityGroupOperations)s).UpdateAsync(affinityGroupName, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }