我使用以下命令启动新的 ConEmu powershell 控制台。
ConEmu64.exe /config "shell" /dir "c:\" /cmd powershell -new_console:n
Run Code Online (Sandbox Code Playgroud)
我想传递一个额外的参数来指定在新控制台启动时运行的 powershell 脚本。以下几乎可以工作,但只打印整个命令而不实际执行它:
ConEmu64.exe /config "shell" /dir "c:\" /cmd 'powershell -noexit -Command {Write-host "Hello world"}' -new_console:n
Run Code Online (Sandbox Code Playgroud)
它产生:
Write-host Hello world
C:\>
Run Code Online (Sandbox Code Playgroud)
虽然我期待:
Hello world
C:\>
Run Code Online (Sandbox Code Playgroud)
删除命令周围的单个配额。ConEmu 执行 switch 后面的完整字符串(命令)/cmd
,只有一个例外 - 在启动控制台之前,所有-new_console...
和-cur_console...
都从该字符串中删除。
ConEmu64.exe /config "shell" /dir "c:\" /cmd powershell -noexit -Command Write-host "Hello world" -new_console:n
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4711 次 |
最近记录: |