How can I launch powershell.exe with the “default” colours from the PowerShell shortcut?

Edit your profile script (pointed to by $profile) and set the desired colors yourself:

# set regular console colors
[console]::backgroundcolor = "darkmagenta"
[console]::foregroundcolor = "darkyellow"

# set special colors

$p = $host.privatedata

$p.ErrorForegroundColor    = "Red"
$p.ErrorBackgroundColor    = "Black"
$p.WarningForegroundColor  = "Yellow"
$p.WarningBackgroundColor  = "Black"
$p.DebugForegroundColor    = "Yellow"
$p.DebugBackgroundColor    = "Black"
$p.VerboseForegroundColor  = "Yellow"
$p.VerboseBackgroundColor  = "Black"
$p.ProgressForegroundColor = "Yellow"
$p.ProgressBackgroundColor = "DarkCyan"

# clear screen
clear-host

Leave a Comment