有没有办法配置visual studio 2015来启动powershell而不是cmd.exe [英] Is there any way to configure visual studio 2015 to launch powershell instead of cmd.exe

查看:391
本文介绍了有没有办法配置visual studio 2015来启动powershell而不是cmd.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上使用visual studio 2015.我有时必须运行Windows控制台应用程序,我必须看到控制台的输出。有一些应用程序特定的原因 为什么这些程序的整个输出不能被
重定向到输出文件中,以及以后可以查看它们。 由于powershell更加用户友好,它会如果visual studio可以启动控制台应用程序的电源架而不是cmd.exe,那就太棒了。


有没有办法配置visual studio 2015以启动电源而不是cmd.exe?


感谢您的任何输入

解决方案

嗨rvsw,



感谢您在MSDN论坛上发帖!



根据您的要求,我建议您下载名为"Open Command"的VS扩展名线"。 Open Command Line扩展支持所有类型的控制台,如cmd,PowerShell,Bash等。您可以通过设置选项中的路径和参数轻松配置
使用的内容。



请按照以下步骤进行设置:



打开你的VS IDE - >工具 - >扩展程序和更新 - >在线 - >在窗口右上角的搜索框中输入"open" - >找到"打开命令行" - >点击"下载"  - >单击"立即重启"按钮。然后
转到工具 - >选项 - >环境 - >命令行 - >在选择预设中选择"电源外壳" - >按"确定"。



此扩展为项目添加新命令上下文菜单,它将在项目的路径上打开命令提示符。如果在解决方案资源管理器中选择解决方案节点,则将在.sln文件的根目录中打开控制台。
更多信息,请参阅此链接:
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpenCommandLine



BTW。请查看来自
的类似帖子
在这里
并查看是否有任何解决方案适合您,特别是Andy S的建议,这是该主题中的第一篇文章。



最好的问候,



I'm using visual studio 2015 on Windows 7. I sometimes have to run Windows console applications for which I have to see the output of the console. There are some application specific reasons on why the entire output for these programs cannot be redirected into the output files and that they can be looked at later. Since the powershell is much more user-friendly, it would be great if visual studio can launch the power shelf for console application's instead of cmd.exe.

Is there a way to configure visual studio 2015 to launch the power shall instead of cmd.exe?

Thank you for any inputs

解决方案

Hi rvsw,

Thank you for posting in MSDN forum!

Based on your requirement, I suggest you to download a VS extension named "Open Command Line". The Open Command Line extension supports all types of consoles like cmd, PowerShell, Bash and more. You can easily configure which to use by setting the paths and arguments in the Options.

Please follow the below steps to set it:

Open your VS IDE -> Tools -> Extensions and Updates -> online -> enter "open" in search box in right corner of window -> find "Open Command Line" -> click "download"  -> click "restart now" button. Then go to Tool -> Options -> environment -> Command line -> choose "power shell" in select preset -> press "OK".

This extension adds a new command to the project context menu that will open a command prompt on the project's path. If the solution node is selection in Solution Explorer, then a console will open at the root of the .sln file. More information you can refer to this link : https://marketplace.visualstudio.com/items?itemName=MadsKristensen.OpenCommandLine

BTW, if you want to use PowerShell with the Visual Studio Command Prompt. please have a look this similar thread from here and see if any of the solutions posted work for you, especially Andy S’s suggestion which is the first post in the thread.

Best Regards,

May


这篇关于有没有办法配置visual studio 2015来启动powershell而不是cmd.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆