Search code examples
windowspowershellcommand-lineappearance

Change PowerShell appearance - Command Line on line below directory


I was wondering if it is possible to change the appearance of PowerShell, so you have the command line a line below your directory line:

C:\your\directory\path\will\go\here >
$ now-a-super-long-command-can-be-entered-here

Solution

  • You need to modify the prompt function.

    The following would do what you want:

    function prompt {
        Write-Host "$(Get-Location) > "
        return "$ "
    }
    

    Simply pasting it into an existing PowerShell window will enable it immediately. If you want to make it permanent, add it to your profile.ps1.

    This link has information about modifying the profile.