繁体   English   中英

在交互式Powershell窗口(如Powershell ISE)中使用“ Visual Studio代码”

[英]Using “Visual Studio code” with interactive Powershell window like Powershell ISE

我事先的帮助是新来的Visual Studio代码这样的感谢。

我经常使用PowerShell的ISE一个互动PowerShell窗口。 我打开它,输入几个命令,然后运行一个脚本(如Office 365的打开PowerShell会话),然后键入几个命令。

有没有办法做与Visual Studio代码是一回事吗? 我看到了一种运行脚本并调试它们的方法,但是还没有完成它们,但是PowerShell窗口仍然存在,因此我可以继续工作。

决定转换为答案,因为注释太多了:

转到设置>用户设置,然后将“ terminal.integrated.shell.windows”更改为:

"C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",

Ctrl + Shift +`打开终端。 使用终端窗口上的+按钮,您可以启动其他Powershell实例。

还有一个扩展 ,允许在同一VSCode进程(cmd,powershell,bash等)下启动多个不同的终端。 细微的差别是,shell以与VSCode相同的权限启动,但是您可以在shell中重新提升一次。

参考文献:
https://code.visualstudio.com/docs/editor/integrated-terminal https://code.visualstudio.com/docs/customization/userandworkspace
https://github.com/Microsoft/vscode/issues/10893

编辑:但是我想说这不是很方便,终端占用了屏幕上太多的空间(好吧,除非您有2k或4k的显示屏),所以我使用powershell + vscode。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM