internal CimCmdletInvocationContext(CimCmdletDefinitionContext cmdletDefinitionContext, Cmdlet cmdlet, string namespaceOverride)
        {
            this._defaultCimSession      = new Lazy <CimSession>(new Func <CimSession>(CimCmdletInvocationContext.CreateDefaultCimSession));
            this.CmdletDefinitionContext = cmdletDefinitionContext;
            this.NamespaceOverride       = namespaceOverride;
            this.CmdletInvocationInfo    = cmdlet.MyInvocation;
            MshCommandRuntime commandRuntime = cmdlet.CommandRuntime as MshCommandRuntime;

            this.DebugActionPreference = commandRuntime.DebugPreference;
            Cmdlet           cmdlet1 = cmdlet;
            ActionPreference debugActionPreference = this.DebugActionPreference;
            string           str  = "Debug";
            Func <string>    func = () => CmdletizationResources.CimCmdletAdapter_DebugInquire;

            CimCmdletInvocationContext.WarnAboutUnsupportedActionPreferences(cmdlet1, debugActionPreference, str, func, () => string.Empty);
            this.WarningActionPreference = commandRuntime.WarningPreference;
            Cmdlet           cmdlet2 = cmdlet;
            ActionPreference warningActionPreference = this.WarningActionPreference;
            string           str1  = "WarningAction";
            Func <string>    func1 = () => CmdletizationResources.CimCmdletAdapter_WarningInquire;

            CimCmdletInvocationContext.WarnAboutUnsupportedActionPreferences(cmdlet2, warningActionPreference, str1, func1, () => CmdletizationResources.CimCmdletAdapter_WarningStop);
            this.VerboseActionPreference   = commandRuntime.VerbosePreference;
            this.ErrorActionPreference     = commandRuntime.ErrorAction;
            this.ShouldProcessOptimization = commandRuntime.CalculatePossibleShouldProcessOptimization();
        }
Example #2
0
        internal CimJobContext(
            CimCmdletInvocationContext cmdletInvocationContext,
            CimSession session,
            object targetObject)
        {
            this.CmdletInvocationContext = cmdletInvocationContext;

            this.Session = session;
            this.TargetObject = targetObject ?? this.ClassName;
        }
Example #3
0
        internal CimJobContext(
            CimCmdletInvocationContext cmdletInvocationContext,
            CimSession session,
            object targetObject)
        {
            this.CmdletInvocationContext = cmdletInvocationContext;

            this.Session      = session;
            this.TargetObject = targetObject ?? this.ClassName;
        }
Example #4
0
        internal CimJobContext(CimCmdletInvocationContext cmdletInvocationContext, CimSession session, object targetObject)
        {
            this.CmdletInvocationContext = cmdletInvocationContext;
            this.Session = session;
            CimJobContext cimJobContext = this;
            object        obj           = targetObject;
            object        className     = obj;

            if (obj == null)
            {
                className = this.ClassName;
            }
            cimJobContext.TargetObject = className;
        }
Example #5
0
		internal CimJobContext(CimCmdletInvocationContext cmdletInvocationContext, CimSession session, object targetObject)
		{
			this.CmdletInvocationContext = cmdletInvocationContext;
			this.Session = session;
			CimJobContext cimJobContext = this;
			object obj = targetObject;
			object className = obj;
			if (obj == null)
			{
				className = this.ClassName;
			}
			cimJobContext.TargetObject = className;
		}