As a junior programmer you are not generally directly taught to use the command line - it is expected that you just pick it up as you go along. This is fine, but people tend to focus on learning to write high quality code as opposed to improving command line skills. Sometimes, it is well worth taking a step back and learning a few command line tricks which improve your efficiency in your development environment.

Below are three simple but non-glaringly-obvious Windows PowerShell tips which I found pretty useful when learning to code:

1. Change the default name of each PowerShell window

By default, each PowerShell window is titled 'shell'.

powershell window showing default name

This is fine, but it can get confusing when you have multiple windows open. In my development environment I might have three (or more) windows open - for this blog, I have one for running my local server, one for my gulp taskrunner and one for admin tasks (these tasks usually consist of running git commands, and navigating the project directory to open files as required). It can look like this:

multiple powershell windows all with the same name

Having to switch between three windows with the same name can get confusing, so renaming them makes it easier! To change the name of your PowerShell window run the command:

$host.ui.RawUi.WindowTitle = "Admin"

Once altered, your shell will display the customized name at the top:

powershell window with name changed

And if you are working with three windows - using one for a Django server, one for gulp and one for admin, you can now easily navigate - as shown below:

multiple powershell windows with customized names

Some programs, gulp included, automatically change the name of the window, which is pretty handy.

2. Change the prompt

Sometimes if you go deep into your directory structure, the directory path can take up way too much space in your PowerShell window:

powershell window change prompt

To get around this you can change the prompt using the following command:

Function prompt {"new_prompt "}

You then have a prompt called new_prompt as follows:

powershell changed prompt

Note: make sure you put a space at the end of your new prompt - otherwise whatever you write in the command line will be pretty unreadable!

3. A couple of important shortcuts

Traditional CTRL + C and CTRL+ V shortcuts don't work in PowerShell. However, the more you use PowerShell, the more it becomes important that you learn and get used to the (pretty clunky) copy/paste shortcuts that are available to you. Try using:

Learning these two shortcuts will definitely help you in the long run.....