Пример #1
0
 public static void LogEvent(ExEventLog.EventTuple eventInfo, TaskInvocationInfo invocationInfo, string periodicKey, params object[] messageArguments)
 {
     if (TaskLogger.IsSetupLogging)
     {
         return;
     }
     if (messageArguments == null)
     {
         throw new ArgumentNullException("messageArguments");
     }
     object[] array = new object[messageArguments.Length + 3];
     array[0] = TaskLogger.processId;
     array[1] = Environment.CurrentManagedThreadId;
     array[2] = invocationInfo.DisplayName;
     messageArguments.CopyTo(array, 3);
     TaskLogger.LogEvent(invocationInfo.ShellHostName, eventInfo, periodicKey, array);
 }
        // Token: 0x06001681 RID: 5761 RVA: 0x00055284 File Offset: 0x00053484
        private void WriteCommandParams(object sender, EventArgs e)
        {
            TaskInvocationInfo invocationInfo = this.context.InvocationInfo;

            this.savedLogAllAsInfo = TaskLogger.LogAllAsInfo;
            StringBuilder stringBuilder = new StringBuilder();

            foreach (object obj in invocationInfo.UserSpecifiedParameters.Keys)
            {
                string text = (string)obj;
                object obj2 = invocationInfo.UserSpecifiedParameters[text];
                if (obj2 != null)
                {
                    try
                    {
                        stringBuilder.AppendFormat(" -{0}:{1}", text, SetupLoggingModule.GetPSValue(obj2));
                        goto IL_8C;
                    }
                    catch (Exception e2)
                    {
                        this.context.CommandShell.WriteVerbose(Strings.VerboseTaskParameterLoggingFailed(text, e2));
                        goto IL_8C;
                    }
                    goto IL_7F;
                }
                goto IL_7F;
IL_8C:
                if (string.Equals(text, "ErrorAction", StringComparison.OrdinalIgnoreCase) && (ActionPreference)obj2 == ActionPreference.SilentlyContinue)
                {
                    TaskLogger.LogAllAsInfo = true;
                    continue;
                }
                continue;
IL_7F:
                stringBuilder.AppendFormat(" -{0}:$null", text);
                goto IL_8C;
            }
            this.context.CommandShell.WriteVerbose(Strings.VerboseTaskSpecifiedParameters(stringBuilder.ToString()));
        }
Пример #3
0
 public void UpdateSpecifiedParameters(Dictionary <string, object> boundParameters)
 {
     this.UserSpecifiedParameters = TaskInvocationInfo.GetUserSpecifiedParameters(boundParameters);
 }