public override void ExecuteCmdlet()
        {
            NewVMUserParameters parameters = new NewVMUserParameters(this.BatchContext, this.PoolName, this.VMName,
                                                                     this.VM, this.AdditionalBehaviors)
            {
                VMUserName = this.Name,
                Password   = this.Password,
                ExpiryTime = this.ExpiryTime,
                IsAdmin    = this.IsAdmin.IsPresent
            };

            BatchClient.CreateVMUser(parameters);
        }
        /// <summary>
        /// Creates a test user for use in Scenario tests.
        /// </summary>
        public static void CreateTestUser(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);

            NewVMUserParameters parameters = new NewVMUserParameters(context, poolName, vmName, null, behaviors)
            {
                VMUserName = vmUserName,
                Password   = "******",
            };

            client.CreateVMUser(parameters);
        }