Getting started with Windows Powershell

You may have heard of or use Windows PowerShell, but even if it doesn't ring a bell, it's hardly surprising. Windows PowerShell allows you to simplify complex operations on the computer with commands. What is it, and how can you start using it?

Windows is a graphical operating system where you start and control activities with the mouse. To keep the interface nice and tidy, only a limited number of functions are directly accessible, others require you to dive deep into the system and often perform a lot of actions. The same result, but faster and easier to achieve via PowerShell. PowerShell is the command-line interface of Windows where you give text commands to the operating system. Also read: 80 Tips for Windows 8.

Now, when the word PowerShell comes up, many think that it gets very difficult very quickly. However, that is not necessary at all. PowerShell also has plenty to offer for daily use. For example, something that is much faster in PowerShell than in Windows with the mouse, is obtaining system information. An overview of the network cards, the MAC addresses and the IP configuration, for example. In PowerShell it's one command, in Windows a lot of clicking and opening and closing windows.

In addition, you can always filter the output of PowerShell or process it further in a next command. An overview of all shared folders, an overview of the scheduled tasks, adding a task, it can all be done with one command in PowerShell.

01 Starting the console

PowerShell starts by opening the console where you can enter commands that the computer will run when you press Enter. Windows has two such consoles, the Command Prompt and the PowerShell, the latter being by far the most powerful. To start the PowerShell click on Start / All Programs / Accessories / PowerShell / PowerShell. If you are not using Windows 7, but Windows 8 or 8.1, press the Windows key to go to the Metro interface and then type PowerShell. Then click Windows PowerShell.

Windows has two command windows. PowerShell is the most powerful of these.

Starting PowerShell through the Metro interface in Windows 8.

Switching completely to the PowerShell is quite possible. You can continue to use the familiar DOS commands.

02 Giving and executing orders

The PowerShell window is completely blank except for the hungry blinking prompt. That emptiness quickly becomes intimidating (also because there is no indication of what to do). However, the operation is simple. At the prompt, you can type a command that will be executed by the computer as soon as you press Enter.

To see which version of PowerShell you are using, type the command host and press Enter. Bee version you now see the version of PowerShell, version 1 was Windows XP and Vista. Versions 2 through are in Windows 7, 8 and 8.1 respectively. To close the console use the command exit again followed by a press of Enter. Use the up and down arrow keys to scroll through previously used commands.

Windows XP, Vista 7, 8 and 8.1 contain different versions of PowerShell, although they all look the same.

03 cmdlets

A command that PowerShell can execute is called a cmdlet (command-let). There are thousands of variants of these, but the number that is actually available on a PC depends entirely on the version of Windows and any additional software installed. For example, PowerShell in Windows 8 has just over 400 cmdlets by default. To see them all, you can use the command Get-Command to use. After the Enter the long list flies across the screen.

Scroll through it and you'll see that the name of a cmdlet immediately describes what the command does. The name always starts with an operation, then a dash and then the part on which the command should be executed, for example Get-Printjob or Set-Date.

PowerShell in Windows 8 has just over 400 cmdlets by default.

Launch PowerShell with more privileges

When you start PowerShell, the program gets the same permissions as you do. And you were often the administrator of the PC under Windows XP and Vista, under Windows 7 and 8(.1) you are no longer that. You are just a regular user and so is PowerShell. But for many tasks, PowerShell needs more permissions. Starting PowerShell with the additional rights of an administrator can be done by right-clicking on the PowerShell link and choosing Run as administrator.

If PowerShell is started with extra rights, you can see this in the title bar, instead of Windows PowerShell, Administrator: Windows PowerShell. You can also enable this by default by right clicking on the shortcut, then click Properties / Shortcut / Advanced / Run as administrator.

An error message in PowerShell is often the result of too few permissions. Starting PowerShell with administrator rights is often the solution.

04 Parameters

Besides as separate commands, the cmdlets can also be supplemented with extra parameters. The additional parameters provide the ability to control the execution of the cmdlet. A parameter always starts with a space and a dash with the name of the parameter attached to it, then a space and then the filling in of the parameter.

For example Get-Process lists all running processes with their memory and processor usage, but Get-Process -ProcessName explorer only gives that specific to the process called explorer.

The difference between the Get-Process and Get-Process cmdlet with additional parameters.

Recent Posts