What is PowerShell in Windows 10? How to start it?
What is PowerShell and how it differs from command prompt (DOS)?
Windows is an operating system which does not much rely on text commands. But still there is a command line available in the Windows from its initial release. We all know that as command prompt or DOS. If you have notice recently Microsoft introduced a new command line ‘PowerShell‘ which looks like DOS. It is more powerful then traditional command line. In this article we will discuss about the PowerShell command line.
What is PowerShell?
Powershell is an advanced version of the command prompt. You can create your own commands and scripts in the PowerShell using the C#. C# and PowerShell both are well integrated with the .Net framework.
Features of the PowerShell
Below are the features which differ it from the command prompt and make it powerful command line.
As like in the Linux now in Windows as well we can download the packages from the repositories. It make it easy to manage packages to download, install and remove. It have eliminated the need of visiting different websites to download the packages.
Secure Shell (SSH)
The is also one of the most useful feature introduced by the Windows in Powershell. Now we can establish a secure connection over SSH to other machines. Before this a third party software was used to do this. Most popular third party software used for this was Putty. Powershell have eliminate the need of any third party software to connect to the other machine or server through secure shell.
Some other features it includes are:
- Remote execution of the tasks.
- Tasks in the background.
- Command Piping: As in Linux now we can join two or more commands using pipe method. Now this can be possible in windows as well.
How to run PowerShell?
There are 3 common methods to start powershell.
1. PowerShell can be run from the ‘Run’ by typing command “powershell“. Either type in the search box or press Win + R button to bring up the Run Window and type powershell in it.
2. Second method is which is available only in Windows 10. Right click on the Start Button and select one of the option : Windows Powershell (admin). It will start the powershell as an administrator. To do most of the tasks you need administrative permission so it is good idea to always start as an admin.
3) Third method to start the powershell is within Command Prompt itself. You can just type the powershell and hit enter. A PS C:\> shows that now you are in powershell mode. You can type Exit to switch back to the command prompt.
Q: Why we need a command line in Windows?
A: Mostly all of the tasks can be done with the graphical interface in Windows but sometime still we need command line interface specially for power users or to troubleshoot issues in Windows. Microsoft firstly introduced the DOS (command.com) and then they improve it as the command prompt (cmd.exe) and after that PowerShell command interpreter came into the existence. It is much powerful then the command prompt.
Q: Can we run the DOS commands in powershell?
A: Simple answer for this is ‘Yes’. Actually powershell commands are different then the cmd commands . Cmdlets are used in powershell. But with the help of aliases it can be possible. Aliases run the equivalent cmd command. See the below example to list files in the directory.
Use the command Get-Alias to check the equivalent dos commands available as an alias. If the alias is set in the powershell then even you can use the ‘dir’ command in powershell mode as well.
Q: Can we run powershell commands in cmd?
A: Simple answer for this is ‘Yes’. Actually you can’t run the powershell command in dos but you need to initiate the powershell command line within the DOS. After that you can run the powershell commands.