Mrc*_*ief 4 eclipse powershell
我试图在不离开Eclipse IDE的情况下运行Powershell脚本,因此我按如下方式设置外部工具配置:
在"主要"标签下:
位置: C:\ WINDOWS\system32\windowspowershell\v1.0\powershell.exe
工作目录: C:\ WINDOWS\system32\windowspowershell\v1.0 \
参数: "&C:\ PowershellScripts\script.ps1"
我保存并单击运行但没有任何反应.控制台窗口保持打开状态,在标题中打开C:\ WINDOWS\system32\windowspowershell\v1.0\powershell.exe.我点击红色停止按钮,但注意似乎无论如何都会发生.该脚本未被执行.
我错过了什么?
我可能会使用-file参数,如
-file "C:\PowershellScripts\script.ps1"
Run Code Online (Sandbox Code Playgroud)
如果系统上尚未将执行策略设置为不受限制,则可能需要先设置执行策略.
在我的机器上,一个带有64位Eclipse和64位jdk(1.6)的Windows 7 64位盒子,如果我将"arguments"字段设置为:
-executionpolicy unrestricted -file "c:\code\test.ps1"
Run Code Online (Sandbox Code Playgroud)
另一个对我有用的替代方案是:
将应用程序设置为启动,C:\Windows\System32\cmd.exe
将参数字段设置为:
/c "powershell -executionpolicy unrestricted -file c:\code\test.ps1"
Run Code Online (Sandbox Code Playgroud)
这对我来说似乎过于Rube Goldbergian,但值得一试,看看你的问题是否可以通过使用普通的shell来解决.
我做了一些类似于你描述的症状,但我不能再复制它们了.
归档时间: |
|
查看次数: |
5165 次 |
最近记录: |