DEV Community

taijidude
taijidude

Posted on

Change the prompt in powershell

Hello everyone,

short post this week. Was working on another post but not really satisfied with it. So you get this short intermission.

What i learned not to long ago ist, that you are able to change you prompt in powershell. You have to put a function named prompt into your Powershell Profile.


function prompt {"PS: $(get-date) / $PWD \n >"}

Enter fullscreen mode Exit fullscreen mode

And after the next start you will get the changed prompt:

Alt Text

By the way a line break in powershell is written like this:

"`n"
Enter fullscreen mode Exit fullscreen mode

The double quotes are important, if you use single quotes it will not work.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more