Ejemplo n.º 1
0
 // Token: 0x0600011E RID: 286 RVA: 0x00004D0C File Offset: 0x00002F0C
 internal static void RunTimedOperation(AnchorContext context, Action operation, object debugInfo)
 {
     AnchorUtil.RunTimedOperation <int>(context, delegate()
     {
         operation();
         return(0);
     }, debugInfo);
 }
Ejemplo n.º 2
0
        public Collection <T> RunPSCommand <T>(PSCommand command, out ErrorRecord error)
        {
            PowerShellProxy powerShellProxy = null;
            Collection <T>  result          = AnchorUtil.RunTimedOperation <Collection <T> >(this.Context, delegate()
            {
                powerShellProxy = new PowerShellProxy(this.runspaceProxy, command);
                return(powerShellProxy.Invoke <T>());
            }, AnchorRunspaceProxy.GetCommandString(command));

            if (powerShellProxy.Failed)
            {
                error = powerShellProxy.Errors[0];
                return(null);
            }
            error = null;
            return(result);
        }