r/PowerShell • u/weebsnore • Jan 24 '20
Pop up a SimCity-style PowerShell loading screen
6
u/HardCodedCoffee Jan 24 '20
You can also utilize some console magic to overwrite the existing line without clearing the entire screen, if you so wish. The backspace character (`b) would be a good place to start, if you're interested.
Edit: Good job, by the way!
3
7
u/ihaxr Jan 24 '20
Just need to use `r to get back to the start of the line:
[console]::Write("`r" + $message.PadRight($host.UI.RawUI.WindowSize.Width),1)5
4
u/HardCodedCoffee Jan 25 '20
I knew there was one, I just couldn't remember offhand. Thanks! If I recall, it does require ensuring that the original line isn't written with a newline character at the end.
91
u/threedaysatsea Jan 24 '20 edited Jan 24 '20
If you are not reticulating splines, are you really doing anything at all?
10
7
7
3
u/evileagle Jan 25 '20
That's my default DEPNotify message in JAMF. It's really the best loading message ever.
5
4
u/Nakatomi2010 Jan 24 '20
I have a script that processes group memberships and generates a report when done.
Had an issue where I couldn't tell if it was running because the output stream as it was running looked very similar.
So I changed to a get-random of colors I'd listed. So when it ran it was just a bunch of rainbow stuff
2
Jan 25 '20
If it doesnt contain a rosebud or porntipsguzzardo cheat then Will Wright will be disappointed.
1
1
15
u/weebsnore Jan 24 '20
Hey,
I've written a blog post about a PowerShell module that creates a fun loading screen:
https://blog.osull.com/2020/01/24/pop-up-a-simcity-style-powershell-loading-screen/
Hope you enjoy it!