The information about the settings for your PowerShell's shell colors are stored in the object model at:
System.Management.Automation.Internal.Host.InternalHost and at
System.Management.Automation.Internal.Host.InternalHostRawUserInterface
under the PrivateData and RawUI Properties
you can see the various settings by typing
$host.PrivateData and pressing enter
PS C:\Users\Stacy> $host.PrivateData
ErrorForegroundColor : Red
ErrorBackgroundColor : Black
WarningForegroundColor : Yellow
WarningBackgroundColor : Black
DebugForegroundColor : Yellow
DebugBackgroundColor : Black
VerboseForegroundColor : Yellow
VerboseBackgroundColor : Black
ProgressForegroundColor : Yellow
ProgressBackgroundColor : DarkCyan
Or by typing $host.UI.RawUI
ForegroundColor: DarkYellow
BackgroundColor: Black
CursorPosition: 0,70
WindowPosition : 0,21
CursorSize: 25
BufferSize: 120,3000
WindowSize: 120,50
MaxWindowSize: 120,84
MaxPhysicalWindowSize: 274,84
KeyAvailable: False
WindowTitle : Windows PowerShell
Now if you don't care for the red error text and would rather see it in green, type this
(get-host).PrivateData.ErrorForegroundColor = 'Green'
You also could have used Get-Host alias $host, like this:
$host.PrivateData.ErrorForegroundColor = 'Green'
Either way, powershell will just prompt back to normal, it will seem like nothing happened. You can verify that it worked by typing this
$host.PrivateData.ErrorForegroundColor = Green
without the single quotes and including Green.
It will result in an error, the error text will be Green with a black Error background color.
If you want to see information about the User Interface
$host.UI.RawUI | gm
If you wanted to change the background color of your current shell to black:
$host.ui.rawUi.backgroundcolor = 'Black'
press enter
cls
press enter
If you want your shell to always open up with a black background, you could create a folder in your my documents folder and name this new folder, WindowsPowerShell. Then create a .ps1 file and include these two lines of code:
$host.ui.rawUi.backgroundcolor = 'Black'
cls
This channel, by Don Jones, on YouTube has really, quick and easy PowerShell tutorials on the above information and more: https://www.youtube.com/playlist?list=PL6D474E721138865A
Video Content
Translate
Subscribe to:
Post Comments (Atom)
Popular Posts
-
When you're migrating sites using export-spweb and import -spweb , you might receive an error message on the import, when reviewing th...
-
Here are a couple ways to copy content around in SharePoint: Backup-SPSite and Restore-SPSite and Export-SPWeb and Import-SPW...
-
Log onto each additional server that you wish to join into the farm Open the ”SharePoint 2010 Management Shell” administratively (righ...
-
Let's say you go to provision a Project Web App via managed service applications, project server server application, and it fails. Ther...
-
Configuring User Profile Synchronization Service Applications for SharePoint 2010 or SharePoint 2013This post assumes you've already installed the SharePoint Binaries (Grey Wizard), and that you are not using the Farm Config Wizard (Wh...
-
If you ever run into a situation where your farm suddenly fails to create the web application on all front end web servers, in other words i...
-
Sorry to be blogurgitating this week. Here's a really good technet site with a load of virtual labs: SharePoint Server 2010 In...
-
When the need to list out the members of an active directory group arises, say management asks, who are the members of this group, and you d...
-
Once a web application has been extended into a zone, the option to choose that zone disappears from the drop down, off the extend web appli...
-
The steps below turn your team site into a team site that is capable of using publishing features and capabilities. But all they really do,...
No comments:
Post a Comment
Thanks for commenting, if you have a question and want a reply, please post it on TechNet forums and reference this blog, or navigate to www.SharePointPapa.com and post it there, all of these blog posts and more are on my SharePoint Papa site.