/// <summary> /// Sets up the machine which may involve booting, configuration, etc. /// </summary> public override void Setup() { var credential = GlobalSettings.Items.DomainAdminCredential; TraceFactory.Logger.Debug("Starting VIRTUAL machine" + _machine.Name); string dispatcher = Dns.GetHostEntry("").HostName; // Split out the commands by line, then remove all the comments (start with "::") // and join them together with the && operator to make it a single statement List <string> commands = Properties.Resources.WindowsClientSetup .Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList(); // Remove all the comments and join the commands together with the && operator to make it a single statement commands.RemoveAll(n => n.StartsWith("::", StringComparison.Ordinal)); string commandList = string.Join(" && ", commands); // Run the statement as a guest process on the VM VMController.RunGuestProcess ( _machine.Name, Environment.GetEnvironmentVariable("comspec"), "/c " + commandList.FormatWith(dispatcher, Manifest.SessionId), credential ); }