How achieve a two line Prompt? How achieve a two line Prompt? powershell powershell

How achieve a two line Prompt?


The PowerShell equivalent of your batch-prompt is:

function prompt { "[$(Get-Location)\]`r`n$("+"*(Get-Location -Stack).Count)>" }#`r`n is just a shorter way of writing [System.Environment]::NewLine

Add it to the profile to suits your needs:

AllUsersAllHosts:

C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1

AllUsersPowerShell:

C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1

AllUsersISE:

C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShellISE_profile.ps1

CurrentUserAllHosts:

C:\Users\username\Documents\WindowsPowerShell\profile.ps1

CurrentUserPowerShell:

C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

CurrentUserISE:

C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1