Powershell Prompts

Thomas Rushton wants to customize his Powershell prompt:

By default, your PowerShell prompt is “PS <<path>> >”. So normal; so dull. However, that can be easily changed. In my case, I want to add:

  • the current time (well, the time at which the prompt was generated)
  • a reminder which account I’m using (I have two – a “normal user” one, and a “DBA/SU” one
  • a countdown of seconds remaining until my next holiday

Oh, and I still need to see the current path.

Very interesting.  By contrast, here’s how to change a Bash prompt.

Related Posts

Failing Pester Tests Can Still Show Green

Shane O’Neill walks us through an oopsie moment: In modifying the template, I forgot to take out the original It block and just put my It block inside it. This lead to my block “pass by deafult” failed (as it should cause of that typo) but the original, parent block it was in “does something useful” passed! Click […]

Read More

Quick Thoughts on Dot-Sourcing in Powershell Modules

Cody Konior wants to speed up module loading: One of the more heated ideas is that you should combine all of your scripts into a massive file and execute it once instead. Currently dbatools uses a mix of these techniques in great detail and to great success. I don’t want to use a single file because I […]

Read More

Categories

September 2016
MTWTFSS
« Aug Oct »
 1234
567891011
12131415161718
19202122232425
2627282930