Thread: Prompt
View Single Post
Old 08-16-2006   #4 (permalink)
=?Utf-8?B?ZGFuY2UyZGll?=


 
 

Re: Prompt


function prompt
{
# display Computer name, username and the date time
write-host -NoNewLine "[$($env:ComputerName)] [$($env:UserName)]
$(get-date)`n"
# Add a logic for displaying Network path for Network drive
# not implemented...

# display current working directory
write-host -NoNewLine "$(pwd)`n"

# display Stack level
Write-Host -NoNewLine ("+" * ((Get-Location -Stack).count))
">"
}

Uhm, I am not sure how to resolve a network path for network drive...
but once I figure out how to retrieve a network drive path, it won't be hard
to add that functionality.

Anyways, above should be close to what you wanted(you can change "get-date"
to produce other date format if you want to...

====================
Sung M Kim

Please don''t bother me with spam...

My System SpecsSystem Spec