Another nice progress system that is in active development for .NET Core (like super active...I can see they updated code an hour ago!) is called Kurukuru. This code is less about progress bars and more about spinners. It's smart about Unicode vs. non-Unicode as there's a lot of cool characters you could use in a Unicode-aware console that make for attractive spinners.

Kurukuru is also super easy to use and integrated into your code. It also uses the "using" disposable pattern in a clever way. Wrap your work and if you throw an exception, it will show a failed spinner.

Spinner.Start("Processing...", () =>{ Thread.Sleep(1000 * 3);

// MEMO: If you want to show as failed, throw a exception here. // throw new Exception("Something went wrong!");});

TIP: If your .NET Core console app wants to use an async Main (like I did) and call Kurukuru's async methods, you'll want to indicate you want to use the latest C# 7.1 features by adding this to your project's *.csproj file:

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

If you use something like ConEmu instead of the Windows shell the results will be much nicer.

Ronald

Monday, 04 December 2017 17:34:19 UTC

I had to write a command-line utility to perform a long-running but variable-length task, and needed to add some sort of asynchronous progress spinner to let the user know the command was still actively working and the machine wasn't frozen. I came up with a pattern that I figured was hypnotic enough to keep the user distracted, but while I originally called it a "Hypnotic sparkle-bob", it ended up being called the "throbber":

°º¤ø,¸,ø¤º°`

Next time, though, I'd probably turn to Kurukuru.

Mike C

Monday, 04 December 2017 19:15:22 UTC

I wrote a one-line Powershell countdown timer for inserting a short pause without requiring a keystroke, for when something is about to happen and you want to briefly show output from the last commmand: