How can I reset the powershell colors

Solution 1:

This resets the console colors (e.g., [Console]::BackgroundColor): (Paste in the powershell console)

[Console]::ResetColor()

Solution 2:

I realize this is an old question, but I found it in Google and have another solution.

Set-PSReadlineOption -TokenKind Command -ForegroundColor Black

Source

This will change the input text to black. The available color choices are as follows:

  • Black
  • DarkBlue
  • DarkGreen
  • DarkCyan
  • DarkRed
  • DarkMagent
  • DarkYellow
  • Gray
  • DarkGray
  • Blue
  • Green
  • Cyan
  • Red
  • Magenta
  • Yellow
  • White

You can make this persist by adding it to your profile. It's enough to append the command to the end of the file.

In my case the profile is in: C:\Users\Billy\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

To get the location of your PS profile type:

$profile

If this file doesn't exist, you can create it with:

New-item –type file –force $profile

(source)

To see the current settings in your profile, use:

Get-PSReadlineOption

(source)

Solution 3:

The colors you see by right clicking on the title bar and clicking on Properties are actually stored in the shortcut file itself in the ExtraData section. You can just delete shortcut and recreate it, or you can use a hex editor to change the values. Outside of that, there is not "reset" feature. This is also true for the normal command prompt.

010 Editor Screenshot

Solution 4:

Answer

With respect to the original question, the yellow text is intentional. It is syntax coloring from the PSReadLine module. This coloring is the (new) default for Windows PowerShell.

As PetSerAl mentioned, Remove-Module PSReadline will remove the highlighting for that session. If you want to permanently remove PSReadLine then modify your PowerShell profile with these PowerShell commands:

if (!(Test-Path -Path $PROFILE)) {
  New-Item -ItemType File -Path $PROFILE -Force
}
Add-Content $PROFILE "`nRemove-Module PSReadline"

If you want to change the syntax coloring, follow the documentation for Set-PSReadLineOption. Specifically, look at parameters with "color" in their name. And make sure to set the version in the documentation to match your PowerShell version. (One exception is Windows 10 version 1809 and later which uses the PowerShell 6.0 syntax.)

Where to change the PowerShell version on the Microsoft documentation Web site.

Example

For example, if you wanted to change the command text color from yellow to magenta then (using the PowerShell 6 syntax) you could enter the following into a PowerShell:

Set-PSReadLineOption -Colors @{
"Command" = [ConsoleColor]::Magenta
}

Keep in mind this is temporary and would have to be added to your PowerShell profile to become permanent.


Fixing Shortcut Colors

If, on the other hand, you saw the shortcut properties screen capture in the original question and thought, "Hey, I screwed up my shortcut colors," then this answer is for you.

As Drew Chapin points out, an easy solution to fix that issue is to recreate the shortcut. But if you just create a new shortcut and point it to powershell.exe, you'll get a black and white shell.

PowerShell in black and white.

If you want the nice blue and white shell, you'll have to do something else.

PowerShell with default blue color.

Before you create new shortcuts, it is a good idea to clear out the ones causing the problem. If you have them pinned somewhere and are not sure where the actual shortcut file is located then below are some common locations. Enter these paths into the File Explorer address bar, one at a time, and poke around. In some instances, I give the path to a parent folder and suggest that you use the search function in File Explorer to search for "powershell" in the subfolders:

shell:Common Desktop
shell:Common Start Menu    search for "powershell"
shell:Common Startup
shell:Quick Launch
shell:Start Menu           search for "powershell"
shell:Startup
shell:User Pinned          search for "powershell"

Typing a shell command into the File Explorer address bar.

Searching for "powershell" in a parent folder.

Creating New PowerShell Shortcuts

Coming back to fresh shortcuts, the do-it-yourself solution is to create a new Windows user and to copy the PowerShell shortcuts from their start menu. You can find the shortcuts by opening File Explorer and navigating to:

shell:Start Menu\Programs\Windows PowerShell

If you don't want to go through the trouble of creating a new user or are unable to do so, I created a PowerShell script that will create the shortcuts for you. Change directory to where you want the shortcuts created. Then either paste the following commands in a PowerShell or save and execute them as a .ps1 file. Remember that the shortcuts will be created in the current working directory.

Example

  1. Open PowerShell.
  2. Change directory to the PowerShell folder in the Start Menu.
set-location "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell"

  1. Remove the existing shortcuts (if they're giving you problems).
remove-item .\*.lnk -whatif
  1. Run the script below.
# Base64-encoded PowerShell .lnk files from a new Windows user profile. 
# Windows 10.0.17763.615 en-US

$windowsPowerShellLnk = @"
TAAAAAEUAgAAAAAAwAAAAAAAAEbfAgAAIAAAAJuvlrfNas0Bm6+Wt81qzQGAHQKo3WrNAQDwBgAAAAAAAQAAAAAAAAAAAAAAAAAAAPEBFAAfUOBP0CDqOmkQotgIACswMJ0ZAC9DOlwAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
"@


# Decode and save to file.  

[System.IO.File]::WriteAllBytes("$pwd\Windows PowerShell.lnk",           ([System.Convert]::FromBase64String($windowsPowerShellLnk)))
[System.IO.File]::WriteAllBytes("$pwd\Windows PowerShell ISE.lnk",       ([System.Convert]::FromBase64String($WindowsPowerShellISE)))
[System.IO.File]::WriteAllBytes("$pwd\Windows PowerShell (x86).lnk",     ([System.Convert]::FromBase64String($WindowsPowerShellx86)))
[System.IO.File]::WriteAllBytes("$pwd\Windows PowerShell ISE (x86).lnk", ([System.Convert]::FromBase64String($WindowsPowerShellISEx86)))

# Trailing comment as a selection-aid for Stack Overflow readers. 

Also, I have some commentary on the thread to date.

The answers that set out to reset the PSReadLine colors assume that those colors have been permanently set to non-defaults. That is unlikely because you would have to make a change to your PowerShell profile. And you would know if you changed your profile.

The other problem here is that yellow is the intended color for commands in the default PSReadLine scheme. So any reset would only give the original poster the same yellow text.

With respect to non-default colors, an easy test is to close and reopen PowerShell. If, when typing a command, the text is yellow then you're probably OK; whatever was troubling you was limited to that PowerShell session and is now gone.

If you want to check your PowerShell profile for any (permanent) Set-PSReadLineOption commands then enter

notepad $profile

into PowerShell and browse through the text file that opens. If you receive an error then you don't have a profile, (and it can't be the problem).

Solution 5:

Edit: as pointed out by @dhobbs in the comments, this is no longer an option in PowerShell 6: https://docs.microsoft.com/en-us/powershell/module/PSReadline/Set-PSReadlineOption?view=powershell-6.

Resetting the PowerShell console colors to their defaults can be done with the following command:

Set-PSReadlineOption -ResetTokenColors 

Documentation here: https://msdn.microsoft.com/en-us/powershell/reference/5.1/psreadline/set-psreadlineoption

Add the line to your PowerShell profile to make it have the command run each time a PowerShell console is opened. To see the location of your PowerShell profile, from a PowerShell console type:

$profile