Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        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));
        }