Example #1
0
        /// <summary>
        /// Execute the specified command line
        /// </summary>
        /// <param name="commandLine">Command line to execute.</param>
        public bool ExecuteInternal(string commandLine)
        {
            IsDebuggingCommandReady = false;
            IntPtr hostProcessWindowHandle = NativeMethods.FindWindow(
                null,
                string.Format(
                    PowerShellTools.Common.Resources.HostProcessWindowTitleFormat,
                    Process.GetCurrentProcess().Id,
                    PowerShellTools.Common.Constants.PowerShellHostExeName));

            NativeMethods.SetForegroundWindow(hostProcessWindowHandle);
            return(DebuggingService.Execute(commandLine));
        }