How to Change Secondary/Multi-line (>>) Prompt for PowerShell

529 views Asked by At

I've found plenty of instructions for changing the primary PowerShell prompt (i.e. prompt(); here is an example of one of the many helpful resources: http://blog.dabasinskas.net/customizing-windows-powershell-command-prompt/) which is great, but I haven't been able to find anything concerning how to change the secondary/multi-line prompt (>>), or the Windows equivalent of the $PS2 string on Linux/Unix systems.

Here is an example of a change,

[current_directory] $   `
>>

from >> to $

[current_directory] $   `
$

Thanks.

2

There are 2 answers

1
Kirill Pashkov On

You can use the grave accent (or backtick):

PS C:\> Get-Service `
>> -name audiosrv
0
Dabombber On

For PowerShell 7, this is part of the PSReadLine module.

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