Exemplo n.º 1
0
        private Exception InitializeRunspaceHelper(string command, Executor exec, Executor.ExecutionOptions options)
        {
            Dbg.Assert(!String.IsNullOrEmpty(command), "command should have a value");
            Dbg.Assert(exec != null, "non-null Executor instance needed");

            s_runspaceInitTracer.WriteLine("running command {0}", command);

            Exception e = null;

            if (IsRunningAsync)
            {
                exec.ExecuteCommandAsync(command, out e, options);
            }
            else
            {
                exec.ExecuteCommand(command, out e, options);
            }
            if (e != null)
            {
                ReportException(e, exec);
            }

            return e;
        }
Exemplo n.º 2
0
		private Exception InitializeRunspaceHelper(string command, Executor exec, Executor.ExecutionOptions options)
		{
			ConsoleHost.runspaceInitTracer.WriteLine(string.Concat("running command ", command), new object[0]);
			Exception exception = null;
			if (!this.IsRunningAsync)
			{
				exec.ExecuteCommand(command, out exception, options);
			}
			else
			{
				exec.ExecuteCommandAsync(command, out exception, options);
			}
			if (exception != null)
			{
				this.ReportException(exception, exec);
			}
			return exception;
		}