Exemple #1
0
        private CommandProcessorBase _CreateCommand(string commandName, CommandOrigin commandOrigin, bool?useLocalScope)
        {
            if (this.context == null)
            {
                throw PSTraceSource.NewInvalidOperationException("DiscoveryExceptions", "ExecutionContextNotSet", new object[0]);
            }
            CommandDiscovery commandDiscovery = this.context.CommandDiscovery;

            if (commandDiscovery == null)
            {
                throw PSTraceSource.NewInvalidOperationException("DiscoveryExceptions", "CommandDiscoveryMissing", new object[0]);
            }
            return(commandDiscovery.LookupCommandProcessor(commandName, commandOrigin, useLocalScope));
        }