如何更改 PowerShell 的辅助/多行 (>>) 提示

问题描述 投票:0回答:2

我发现了大量有关更改主要 PowerShell 提示符的说明(即

prompt()
这里是许多有用资源之一的示例:http://blog.dabasinskas.net/customizing-windows-powershell-命令提示符/)这很棒,但我还没有找到任何有关如何更改辅助/多行提示符(
>>
),
或Windows等效的
$PS2
字符串的信息在 Linux/Unix 系统上。

这是一个更改的示例,

[current_directory] $   `
>>

>>
$

[current_directory] $   `
$

谢谢。

powershell prompt multiline
2个回答
0
投票

对于 PowerShell 7,这是 PSReadLine 模块的一部分。

PS C:\> (Get-PSReadLineOption).ContinuationPrompt
>> 
PS C:\> Set-PSReadLineOption -ContinuationPrompt '~~ '
PS C:\> @'
~~ 

-1
投票

您可以使用重音符号(或反引号):

PS C:\> Get-Service `
>> -name audiosrv
© www.soinside.com 2019 - 2024. All rights reserved.