Colors are cool ! What about giving our very own PowerShell Console some splash of colors.
HOW IT WORKS :
Access the BackgroundColor attribute of the $Host variable and change it as desired, like in the screenshot below.
NOTE : We are passing the Decimal value of the Colors in this attribute and Last value set by my function is 5 ( Five ) , which is the Default value of the PowerShell console (See below Screenshot). So that you don’t have to re adjust the Console colors after running the function.
SCRIPT :
Function Change-BackgroundColor($Color) { $Host.UI.RawUI.BackgroundColor = $Color cls Start-Sleep -Milliseconds 500 }
Hope you find it fun, #HappyThanksGiving to all readers !! 🙂
Prateek Singh
Engineer. Blogger. Science and Technology fan.
Ridiculously Curious and a compulsive Book reader.
Related posts
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,132,873 People Reached