Powershell cmdlet:进程无法访问罚款,因为它正由另一个进程使用

时间:2017-06-20 16:48:45

标签: c# visual-studio powershell

我最近开始学习如何在Visual Studio中使用C#制作Powershell cmdlet。尝试在Visual Studio 2013中构建我的Powershell cmdlet时出现此错误。这迫使我关闭Powershell来构建我的代码,然后再次打开Powershell,这非常烦人。它很可能不是代码的错,因为即使使用空脚本也是如此。有谁知道如何解决这个问题?提前感谢任何建议。

Powershell版本是v3,带有.NET 4.但版本号无关紧要,我需要这些特定版本才能完成这项工作。

1 个答案:

答案 0 :(得分:0)

看起来这是预期的目的,谢谢@bluuf。看起来最好的办法就是开始这样的新终端:

powershell -NoExit -Command "<whatever you want to execute in the new shell> ; <you can do multiple like this>"

然后当你使用

exit

它将关闭您导入的shell,将您必须键入long命令的原始shell保留为up。只需点击向上箭头,该命令就会再次弹出,准备好重复使用。比再次输入要好得多。