Getting Started With PowerShell

Windows PowerShell is a powerful technology to manage Windows Servers / Clients systems. Windows PowerShell was developed by Microsoft for the purposes of task automation and configuration management. It is an automation and scripting platform for Windows built on top of the object-oriented power of .NET framework. In this article, I will show how to get started with Windows PowerShell and run some basic cmdlets.

Open Windows PowerShell

Find Windows PowerShell in Windows Computer

To find Windows PowerShell in your Windows Computer, go to Start menu —> All Programs—> Accessories —> Windows PowerShell —> Right click on Windows PowerShell —> Click Run as Administrator.

(or)

Go to Start menu —> Type Windows PowerShell in Search box.

Windows PowerShell
Image: PowerShell in Windows 10

Find Windows PowerShell in Windows Server 2016

To find Windows PowerShell in Your Windows Server 2016

Click Start Menu —> Click Windows PowerShell (Find in the screenshot given below).

Windows PowerShell
Image: PowerShell in Windows Server 2016

Once you click Windows PowerShell, it will open up Windows PowerShell console.

Windows PowerShell
Image: Windows PowerShell Console

Download/ Install Windows PowerShell

[Note- If you don’t have Windows PowerShell already installed in your computer, you can get it from Microsoft’s Website, the link provided below.

https://msdn.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell ]

If you want to install Windows PowerShell on your Windows Server Operating system, it can be done by using Server Manager. You can just add Windows PowerShell from the Features, as shown below. 


Windows PowerShell
Image: Add Windows PowerShell From Features in Windows Server 2016

Check the Version of PowerShell

To know the version of PowerShell installed on your Computer, use $PSVersionTable.PSVersion. As you can see below, I have PowerShell 5.0 installed on my computer.

Windows PowerShell
Image: PowerShell Version

PowerShell and PowerShell ISE

As you can see in the second screenshot above, we have Windows PowerShell and Windows PowerShell ISE. ISE stands for an Integrated Scripting Environment. It is same as other IDEs ( Integrated Development Environments ), where you can run the commands and write, test and debug the scripts in a single Windows-based GUI ( Graphic User Interface ) with multiline editing, tab completion, syntax coloring, selective execution, context-sensitive help and the support for right-to-left languages.

Example

To set a line breakpoint, Right-click the line of code and subsequently click Toggle Breakpoint.

You can find the differences between PowerShell Console and PowerShell ISE on Microsoft Website. ( Click this link

https://blogs.msdn.microsoft.com/powershell/2009/04/17/differences-between-the-ise-and-powershell-console/ ).

Windows PowerShell
Image: Windows PowerShell ISE

Customize Your Windows PowerShell

You can easily customize (Change font size, style, increase/decrease layout size and so on) your Windows PowerShell Console by just right clicking on the Administrator (left top corner) and go to Properties.

Windows PowerShell
Image: Open Properties Windows

Once you click Properties, it will open Windows PowerShell Properties Windows, where you can customize PowerShell.

Windows PowerShell
Image: Windows PowerShell Properties windows to Customize

Basic cmdlets (Command-lets)

A cmdlet (Command-let) is a lightweight command. Powershell uses cmdlets (Command-lets) to perform the tasks on the objects on your local or remote machine. Let us look at some basic cmdlets.

  1. Get- Command
    This gives you all the available cmdlets.

    Windows PowerShell

  2. Use Wildcard to Search
    To get all the cmdlets, where there is a S in the Verb-part.

    Windows PowerShell

  3. Get an online help
    To get an online help from MSDN,

    Windows PowerShell

  4. Get all cmdlets for a Service.
    To get all the cmdlets for a Service.

    Windows PowerShell

In PowerShell, you can also run basic Linux/Unix commands like “dir”, “ls”, “cls” and so on.

Up Next
    Ebook Download
    View all
    Learn
    View all