What is Windows PowerShell? This article will answer the question. It also will show some Windows PowerShell commands and the comparison between Windows PowerShell and Windows Command Prompt.

What Is Windows PowerShell?

Windows PowerShell is a Windows command-line shell and scripting language tailored for system administrators. Released by Microsoft, Windows PowerShell combines the old CMD functionality with a new scripting instruction set with built-in system administration functionality.

Windows PowerShell window

Built-on top of the .NET Framework common language runtime and the .NET Framework, Windows PowerShell accepts and returns .NET Framework objects.

Like many shells, Windows PowerShell allows you access to the file system on the computer. It also enables you to access other data stores, such as the registry and the digital signature certificate stores.

Some versions of Windows PowerShell:

  • PowerShell 1.0: Released in Nov. 2006, PowerShell 1.0 was for Windows XP SP2, Windows Server 2003 SPI, and Windows Vista. For Windows Server 2008, it is an optional component.
  • PowerShell 2.0: Integrated with Windows 7, PowerShell 2.0 comes in the shines, like PowerShell remoting, advanced functions (script cmdlets), data langue and etc.
  • PowerShell 3.0: Integrated with Windows 8, PowerShell 3.0 is a part of a larger package. This version features scheduled jobs, improved code writing, session connectivity, and so on.
  • PowerShell 7: PowerShell 7 is the latest supported Windows PowerShell version.

How to Launch Windows PowerShell? What you need to do is typing Windows PowerShell in the Cortana search box and then selecting the searching result named Windows PowerShell.

Functions of Windows PowerShell Commands

Windows PowerShell commands can help you do more. Let’s see what they can do for you.

Note: Some of these commands might change certain settings or configuration on your computer.

# 1: Find a particular file

If you want to find a particular file or a directory in a particular location, you can use Get-Item cmdlet. In other words, the Get-Item cmdlet gets the item at the specified location. Please pay attention that you cannot get the contents of the item with this cmdlet unless you use a wildcard character (*) to request all the contents of the item.

# 2: Launch a UMP Application

PowerShell is a great tool that you can use to launch UWP Applications within seconds by typing Start-Process “ms-settings:”.

Note: Universal Windows Platform (UWP) created by Microsoft is to help develop universal apps that run on Windows 10, Windows 10 Mobile, Xbox One without the need to be re-written for each.

# 3: Read the content of a file

In order to read the content of a file, you can type the Get-Content command like Get-Content <PATH of the file with its extension>.

# 4: Read information about all the services on a computer

The Get-Service cmdlet is used to list all the services running or stopped on your computer.

# 5: Copy a file or a directory

You can use the Copy-Item cmdlet to copy one file or directory to another destination. The syntax for this cmdlet is Copy-Item E:\TWCTest.txt-Destination D:\.

# 6: Delete a file or directory

The Remove-Item cmdlet is used to remove files from one locatio to another. The syntax for this cmdlet is Remove-Item E:\TWCTest.txt.

Windows PowerShell VS. CMD

Windows PowerShell vs CMD

You may find there are some similarities between Windows PowerShell and CMD. The following content will show you their differences.

PowerShell and CMD are completely different, although the dir command works the same way in both interfaces.

Firstly, PowerShell uses cmdlets which are self-contained programming objects that expose the underlying administration options inside of Windows.

Secondly, PowerShell makes use of pipes that allow you to create complex scripts that pass parameters and data from one cmdlet to another to chain together cmdlets and share input or output data the same way as other shells, like bash in Linux.

Thirdly, PowerShell is a new environment for Windows system administrators that uses a more modern command-line environment to manage Windows. However, CMD is just a legacy environment in Windows system. This environment cannot access many Windows system administration features, and it is more difficult to create complex scripts with.

In one word, PowerShell is not just a shell. It is a powerful scripting environment you can use to create complex scripts for managing Windows system far more easily than you do that with CMD.

  • linkedin
  • reddit