PowerShell05 – PowerShell Prompt

Many a time I work on different files in different folders and change the prompt to different location. The challenge is the available space to write commands on single line.

For simplicity, I will share simple function to move the folder location to Window name as shown below…

function prompt
{
  'PowerShell> '
  $host.UI.RawUI.WindowTitle = Get-Location
} 

Powershell_Prompt

One more tip… If you are interested to see the code of function, you can use following method… In below example, I want to see the code for prompt function!

cat Function:\prompt
Advertisements
This entry was posted in Learn_Powershell, Powershell and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s