internal static void Run(string initialCommand)
 {
     lock (SyncObject)
     {
         if (SingletonInstance != null)
         {
             return;
         }
         SingletonInstance = new OutOfProcessMediator();
     }
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OutOfProcessMediator.AppDomainUnhandledException);
     SingletonInstance.Start(initialCommand);
 }
Beispiel #2
0
        /// <summary>
        /// Starts the out-of-process powershell server instance.
        /// </summary>
        /// <param name="initialCommand">Specifies the initialization script.</param>
        /// <param name="workingDirectory">Specifies the initial working directory. The working directory is set before the initial command.</param>
        internal static void Run(string initialCommand, string workingDirectory)
        {
            lock (SyncObject)
            {
                if (s_singletonInstance != null)
                {
                    Dbg.Assert(false, "Run should not be called multiple times");
                    return;
                }

                s_singletonInstance = new OutOfProcessMediator();
            }

#if !CORECLR // AppDomain is not available in CoreCLR
            // Setup unhandled exception to log events
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomainUnhandledException);
#endif
            s_singletonInstance.Start(initialCommand, new PSRemotingCryptoHelperServer(), workingDirectory);
        }
Beispiel #3
0
 internal static void Run(string initialCommand)
 {
     lock (SyncObject)
     {
         if (SingletonInstance != null)
         {
             return;
         }
         SingletonInstance = new OutOfProcessMediator();
     }
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OutOfProcessMediator.AppDomainUnhandledException);
     SingletonInstance.Start(initialCommand);
 }
        /// <summary>
        /// </summary>
        internal static void Run(string initialCommand)
        {
            lock (SyncObject)
            {
                if (null != s_singletonInstance)
                {
                    Dbg.Assert(false, "Run should not be called multiple times");
                    return;
                }

                s_singletonInstance = new OutOfProcessMediator();
            }

#if !CORECLR // AppDomain is not available in CoreCLR
            // Setup unhandled exception to log events
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomainUnhandledException);
#endif
            s_singletonInstance.Start(initialCommand, new PSRemotingCryptoHelperServer());
        }