private PipelineContext(ILogger logger, PSRuleOption option, HostContext hostContext, TargetBinder binder, BaselineContext baseline, IDictionary <string, ResourceRef> unresolved) { _ObjectNumber = -1; _Logger = logger; _RuleTimer = new Stopwatch(); Option = option; HostContext = hostContext; _LanguageMode = option.Execution.LanguageMode ?? ExecutionOption.Default.LanguageMode.Value; _InconclusiveWarning = option.Execution.InconclusiveWarning ?? ExecutionOption.Default.InconclusiveWarning.Value; _NotProcessedWarning = option.Execution.NotProcessedWarning ?? ExecutionOption.Default.NotProcessedWarning.Value; _FailStream = option.Logging.RuleFail ?? LoggingOption.Default.RuleFail.Value; _PassStream = option.Logging.RulePass ?? LoggingOption.Default.RulePass.Value; _NameTokenCache = new Dictionary <string, NameToken>(); DataCache = new Dictionary <string, Hashtable>(); ExpressionCache = new Dictionary <string, object>(); _Reason = new List <string>(); _Binder = binder; Baseline = baseline; _Unresolved = unresolved; Culture = option.Output.Culture; }
private PipelineContext(PSRuleOption option, HostContext hostContext, TargetBinder binder, OptionContext baseline, IDictionary <string, ResourceRef> unresolved) { Option = option; HostContext = hostContext; _LanguageMode = option.Execution.LanguageMode ?? ExecutionOption.Default.LanguageMode.Value; _NameTokenCache = new Dictionary <string, NameToken>(); LocalizedDataCache = new Dictionary <string, Hashtable>(); ExpressionCache = new Dictionary <string, object>(); ContentCache = new Dictionary <string, PSObject[]>(); Binder = binder; Baseline = baseline; _Unresolved = unresolved; }
public static PipelineContext New(ILogger logger, PSRuleOption option, HostContext hostContext, TargetBinder binder, BaselineContext baseline, IDictionary <string, ResourceRef> unresolved) { var context = new PipelineContext(logger, option, hostContext, binder, baseline, unresolved); CurrentThread = context; return(context); }