PowerShell Rainbow


Colors are cool ! What about giving our very own PowerShell Console some splash of colors.

ezgif.com-crop

HOW IT WORKS :

Access the BackgroundColor attribute of the $Host variable and change it as desired, like in the screenshot below.

Rainbow

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.

Rainbow2

SCRIPT :

Function Change-BackgroundColor($Color)
{
$Host.UI.RawUI.BackgroundColor = $Color
cls
Start-Sleep -Milliseconds 500
}

Hope you find it fun, #HappyThanksGiving to all readers !!  🙂

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s