/// <summary>
        /// Deletes the specified user
        /// </summary>
        /// <param name="parameters">The parameters indicating which user to delete</param>
        public void DeleteVMUser(VMUserOperationParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            using (IPoolManager poolManager = parameters.Context.BatchOMClient.OpenPoolManager())
            {
                poolManager.DeleteUser(parameters.PoolName, parameters.VMName, parameters.VMUserName, parameters.AdditionalBehaviors);
            }
        }
        /// <summary>
        /// Deletes the specified user
        /// </summary>
        /// <param name="parameters">The parameters indicating which user to delete</param>
        public void DeleteVMUser(VMUserOperationParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            using (IPoolManager poolManager = parameters.Context.BatchOMClient.OpenPoolManager())
            {
                poolManager.DeleteUser(parameters.PoolName, parameters.VMName, parameters.VMUserName, parameters.AdditionalBehaviors);
            }
        }
        public override void ExecuteCmdlet()
        {
            VMUserOperationParameters parameters = new VMUserOperationParameters(this.BatchContext, this.PoolName, this.VMName,
                this.Name, this.AdditionalBehaviors);

            ConfirmAction(
                Force.IsPresent,
                string.Format(Resources.RBU_RemoveConfirm, this.Name),
                Resources.RBU_RemoveUser,
                this.Name,
                () => BatchClient.DeleteVMUser(parameters));
        }
        /// <summary>
        /// Deletes a user used in a Scenario test.
        /// </summary>
        public static void DeleteUser(BatchController controller, BatchAccountContext context, string poolName, string vmName, string vmUserName)
        {
            YieldInjectionInterceptor interceptor = CreateHttpRecordingInterceptor();
            BatchClientBehavior[] behaviors = new BatchClientBehavior[] { interceptor };
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            VMUserOperationParameters parameters = new VMUserOperationParameters(context, poolName, vmName, vmUserName, behaviors);
            client.DeleteVMUser(parameters);
        }