![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | First basic configuration Hi, I'm new to PowerShell and I'd like to do some basic configuration for the shell: 1. I would like to set up my prompt as in user@xxxxxx[current_working_directory]> where "current_working_directory" should be just the directory (not the full path to the directory) and in dark cyan (on black) and ">" should be in light cyan (the rest should be just standard white on black). Is that doable and what would the prompt function look like? 2. I'd like to assign ^D to do "exit"... Is that doable? 3. What do I have to do to get a persistent history? Thorsten |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: First basic configuration Hi Thorsten, 1. You can't use lightCyan as a console color, possible color values are: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta , DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White. Include this function in your $profile and restart the shell: function prompt{ write-host -NoNewLine -foreground cyan "$env:username@$env:computername[$(split-path -leaf $pwd)]>" " `b " } 2. You can't. 3. See http://blogs.msdn.com/powershell/arc...01/653194.aspx ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: First basic configuration * Shay Levi (Thu, 10 Jan 2008 21:05:37 +0000 (UTC))
cmdlet split-path at command pipeline position 1 Supply values for the following parameters: Path[0]: I press ENTER and then: PS> It also seems that you can only colour one whole line (and not parts of it)...?
the shell with bye (instead of "exit"), then I have to remember to type "get-history" and this just displays the history - what is that useful for - instead of going into the history buffer (Cursor up and down). Thorsten | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: First basic configuration Specify the -path parameter: ....computername[$(split-path -path $pwd -Leaf)].. ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest | Re: First basic configuration
function prompt{ write-host -NoNewLine -fore cyan "$env:username@$env:computername[" write-host -NoNewLine -fore DarkCyan -back black "$(split-path -leaf $pwd)" write-host -NoNewLine -fore cyan "]>" " `b " } ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: First basic configuration * Shay Levi (Thu, 10 Jan 2008 21:50:16 +0000 (UTC))
function prompt { write-host -NoNewLine "$env:username@$env:computername[" write-host -NoNewLine -fore DarkCyan "$(split-path -leaf $pwd)" write-host -NoNewLine "]" write-host -NoNewLine -fore cyan ">" " `b " } Thorsten | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) |
| Guest | Re: First basic configuration Powershell Plus has this sort of functionality, we have some basic hidden apis to bind.. but what would the ideal syntax be for you. I mean how would you like to bind hotkeys to specific code etc? -Karl |
My System Specs![]() |
| | #8 (permalink) |
| Guest | Re: First basic configuration For those who weren't aware, you can also use ctrl-break to exit PowerShell. -- Jon |
My System Specs![]() |
| | #9 (permalink) | ||||||||||||
| Guest | Re: First basic configuration I suppose it could be done either via the application hosting Powershell via a dialog box or command line. One possibility would be Add-Shortcut [-shortcutType] {<Scriptblock>| <Function>} [[-key] <char>] [[-value] <object> "Karl Prosser[MVP]" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| configuration | Graziella | Vista mail | 5 | 07-02-2008 11:54 AM |
| configuration | Graziella | Vista mail | 1 | 04-23-2008 04:07 PM |
| have window vista basic.understand basic don't have fax & scan | jay sureka | Vista print fax & scan | 4 | 01-07-2008 01:02 PM |
| WLAN in Vista Basic LOSE configuration everytime I shut down laptop | lorexx70 | Vista General | 4 | 09-15-2007 04:12 PM |
| PC Configuration | nlcautela | Vista installation & setup | 4 | 06-23-2006 04:36 AM |