我正在尝试使用PowerShell (版本2) Start-Process
并重命名新启动的窗口标题。我有以下代码片段,运行良好,它启动一个新的PowerShell窗口和尾部日志($c
包含日志文件到尾):
Start-Process powershell.exe -Argument "Get-Content", $c, "-wait"
我不知道如何包括以下内容,以便可以更改新启动的窗口标题。
$host.ui.RawUI.WindowTitle = 'New window title rename example text'
干杯。
发布于 2022-03-18 05:11:17
如果有人需要一种简单的方法,您可以在powershell中进行以下操作:
cmd.exe /c "start ""my app"" powershell.exe -NoExit -Command ""dotnet myapp"""
它还意味着cmd中的此命令:
start "myapp" powershell.exe -NoExit -Command "dotnet myapp"
https://stackoverflow.com/questions/27607323
复制相似问题