PowerShell Console

Press CTRL+R to open the Run As dialog. Enter powershell, then press ENTER.

Press WIN, and type powershell. Windows searches for your keyword. Once the application Windows PowerShell is listed, click it

A moment later, the PowerShell Console opens its window. It contains text, and a blinking cursor awaits your commands. Which raises the slight question which commands you can run. We’ll get to that in a second.

First things first: if you get bored, or frustrated, simply close the console window. This will stop PowerShell until you are ready to run it again.

Before you do that, make sure next time it is easier to launch your PowerShell Console:

On your desktop, spot the blue PowerShell icon in your taskbar. Right-click this icon. In the context menu, choose “Pin to taskbar”. This makes sure the icon stays there. In the future, to open the PowerShell Console just click it.

Next, drag the pinned PowerShell icon to the far left. It should be first in line. This way, you can press WIN+1 to launch it, or switch its window into the foreground.

Finally, try it: close the PowerShell Console window, then launch it again by clicking the pinned icon or pressing WIN+1. The PowerShell Console should now have a blue background (it may have been black before).

Once the icon is pinned, when you right-click it, the PowerShell Jumplist opens (see image above). It serves like your PowerShell cockpit and can launch PowerShell with Administrator privileges, or run the ISE Editor instead.

To change the console font, font size, and colors, click the icon on the left side of the console title bar. A context menu opens. Choose Properties.

Your dialog may look a little different, depending on the Windows version you are using. Click the tab “Fonts” to change the font. It’s best to select a “TrueType” scalable font, and pick a font size that is no strain on your eyes.

I know that

Console Properties are tied to the Command Path

Console property settings are always tied to the application path from where the dialog was called.

So if you launch the console via the command “powershell.exe”, the selected properties will be used whenever you launch the console this way. If you have pinned the PowerShell icon to the taskbar and launch it from there, a different set of properties is used, because now Windows uses a link to call powershell.exe (thus the command path is different).

So before you invest time in fine-tuning your console, make sure you have launched it the way that you’ll launch it in the future, too.

On Windows 10 (and Server 2016), the console uses color highlighting: When you enter commands, PowerShell colorizes the components of your input so you can better understand how PowerShell interprets your input.

Installing PSReadLine

Older operating systems do not show this cool feature, regardless of PowerShell version or whether you have updated to the latest PowerShell version. This is because the colorization is done by an open source PowerShell module called “PSReadLine” that ships with Windows 10 and Server 2016.

If you’d like to use PSReadLine on other Windows versions, too, download and install PSReadLine:

PS C:\> Install-Module -Name PSReadLine -Scope CurrentUser

Untrusted repositoryYou are installing the modules from an untrusted repository. If you trust thisrepository, change its InstallationPolicy value by running the Set-PSRepositorycmdlet. Are you sure you want to install the modules from 'PSGallery'?[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help(default is "N"):yPS C:\>

After you consented, the module is downloaded and installed. With Import-Module PSReadLine, you can load the module and enjoy the colorization. PowerShell 5 does this by default on launch. Remove-Module PSReadLine turns colorization off again.

Installing PowerShellGet

If PowerShell can’t find the cmdlet Install-Module, then that’s a Catch22:

Install-Module is your key to easily download and add new modules, but is was introduced only in Windows 10 and Server 2016. Like every cmdlet, Install-Module is part of a module itself, called “PowerShellGet”. So if you don’t have Install-Module, how do you get the module PowerShellGet?

Just navigate to www.powershellgallery.com which is where all the publicly available modules live that are available via Install-Module. The site offers an MSI installer package to install PowerShellGet on older PowerShell versions. Once you download and run this MSI, your PowerShell suddenly has access to Install-Module, and you can download PSReadLine like described above.

Starting with Windows 10, Microsoft has overhauled the console subsystem. To use the new features, open the PowerShell Console properties dialog like described above, and make sure the “Legacy Mode” is not checked.

Next, click the tab “Colors”. In the bottom area, a slider sets the console background transparency, and if you like, you could create shine-through PowerShell Consoles.

What Commands Can I Run?

PowerShell can execute two things: Applications (files with extension .exe), and .NET code. Fortunately you don’t need to be a programmer. PowerShell comes with tons of so-called “Cmdlets”: ready-to-use solutions to do things. Let’s run some PowerShell commands!