Ejemplo n.º 1
0
        internal object CallPowerShellWithoutRequest(string method, params object[] args)
        {
            var cmdInfo = GetMethod(method);

            if (cmdInfo == null)
            {
                return(null);
            }

            var result = _powershell.NewTryInvokeMemberEx(cmdInfo.Name, new string[0], args);

            if (result == null)
            {
                // failure!
                throw new Exception(Messages.PowershellScriptFunctionFailed.format(_module.Name, method));
            }

            return(result.Last());
        }