My Demonstration Prompt

Recently, I have found myself doing a lot of CLI PowerShell demos. Normally, I have a prompt that uses Joel Bennet’s PowerLine module and looks like this.

In my opinion, it’s pretty cool looking, and it gives me a bunch of useful information including the Get-History ID of the line that I ran, the nested prompt level, current drive, the present working directory, the time the last command took to run and whether it was successful, and the current time.

This is way too much information for a regular demo, and ends up in me answering questions about my prompt and explaining it for 5 minutes which eats up valuable demo time. Here’s my new demo prompt.

Not much explaining to do here. Here’s the code I have in my profile to make it happen.

Shout out to Joel and Brandon in the PowerShell Slack for working this one out. It’s pretty simple. $demo is a string that redefines my prompt function and its invoked.

2 thoughts on “My Demonstration Prompt

    1. I don’t. Usually when I am done a demo, I close up shop and shut everything down. The prompt that I start out with is set when my profile loads next time I open the console.

Comments are closed.