![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | RawUI colours I'm working an updated profile.ps1 and want to manage the colours better. I currently do this: $host.ui.rawui.WindowTitle = "PowerShell Rocks!!!" $host.ui.rawui.backgroundcolor="white" $host.ui.rawui.foregroundcolor="darkblue" However, I can't see the properties to enable me to change the colours for the warning and error lines. $Host.UI.WriteErrorLine("Foobar") for example writes red text on a black background. Meanwhile $Host.UI.WriteWarningLine("Foobar") writes with black bakground and yellow text. How do I set the colours for warning and error lines? Also, I note that the two functions differ in another way. If I run them, I see: PSH [D:\foo]: $HOST.UI.WRITEerrorline("Foobar") Foobar PSH [D:\foo]: $HOST.UI.WRITEwarningline("Foobar") WARNING: Foobar Note that the latter prepends "WARNING:" to the line. This behaviour is inconsistent. Seems to me that either WriteErrorLine to should add "ERROR" or WriteWarningLine should not have the "WARNING:" at the front. If adding "warning" or "error" is important, then provide a global Variable (e.g. $WarningTextStart) to define it. Thomas -- Thomas Lee doctordns@gmail.com MVP - Admin Frameworks and Security |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: RawUI colours $host.PrivateData ErrorForegroundColor: Red ErrorBackgroundColor: Black WarningForegroundColor: Yellow WarningBackgroundColor: Black DebugForegroundColor: Yellow DebugBackgroundColor: Black VerboseForegroundColor: Yellow VerboseBackgroundColor: Black ProgressForegroundColor: Yellow ProgressBackgroundColor: DarkCyan "Thomas Lee" wrote: > I'm working an updated profile.ps1 and want to manage the colours > better. > > I currently do this: > > $host.ui.rawui.WindowTitle = "PowerShell Rocks!!!" > $host.ui.rawui.backgroundcolor="white" > $host.ui.rawui.foregroundcolor="darkblue" > > However, I can't see the properties to enable me to change the colours > for the warning and error lines. > > $Host.UI.WriteErrorLine("Foobar") for example writes red text on a black > background. Meanwhile $Host.UI.WriteWarningLine("Foobar") writes with > black bakground and yellow text. > > How do I set the colours for warning and error lines? > > Also, I note that the two functions differ in another way. If I run > them, I see: > > PSH [D:\foo]: $HOST.UI.WRITEerrorline("Foobar") > Foobar > PSH [D:\foo]: $HOST.UI.WRITEwarningline("Foobar") > WARNING: Foobar > > Note that the latter prepends "WARNING:" to the line. This behaviour is > inconsistent. > > Seems to me that either WriteErrorLine to should add "ERROR" or > WriteWarningLine should not have the "WARNING:" at the front. If adding > "warning" or "error" is important, then provide a global Variable (e.g. > $WarningTextStart) to define it. > > Thomas > -- > Thomas Lee > doctordns@gmail.com > MVP - Admin Frameworks and Security > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GUI colours missing | Ildhund | Live Mail | 9 | 05-30-2008 03:31 PM |
| Individual Colours not correctly supported | Axel Dahmen | Vista General | 2 | 03-26-2008 01:15 PM |
| Is it possible to tag winmail messages with colours as you can with Thunderbird? | Peter GODDARD | Vista mail | 0 | 09-27-2007 04:53 AM |
| Colours, date | Catty | Vista General | 5 | 03-28-2007 12:28 PM |
| Demo: some toys with $Host.UI.RawUI and colors | =?Utf-8?B?Um9tYW4gS3V6bWlu?= | PowerShell | 3 | 08-22-2006 12:50 AM |