public void Execute(object sender, EventArgs args)
 {
     var dte2 = (DTE2)Package.GetGlobalService(typeof(SDTE));
     if (dte2 != null && dte2.ActiveDocument != null)
     {
         var launcher = new PowerShellProjectLauncher();
         launcher.LaunchFile(dte2.ActiveDocument.FullName, true);
     }
 }
        public void Execute(object sender, EventArgs args)
        {
            var dte2 = (DTE2)Package.GetGlobalService(typeof(SDTE));
            if (dte2 != null && dte2.ActiveDocument != null)
            {
                var launcher = new PowerShellProjectLauncher();

                TextSelection sel = (TextSelection)dte2.ActiveDocument.Selection;
                if (sel.TopPoint.EqualTo(sel.ActivePoint))
                {
                    sel.SelectLine();

                    launcher.LaunchSelection(sel.Text);
                }
                else
                {
                    launcher.LaunchSelection(sel.Text);
                }
            }
        }