PowerShell.exe is a ‘.exe’ file that can be run on Windows-based Operating Systems like Windows XP, Windows 7, Windows 8.1, Windows 10, and Windows 11.
This article provides an insight into the PowerShell.exe file alongside the following learning outcomes:
How PowerShell.exe works
The PowerShell.exe file contains all the necessary code that is required to run the PowerShell terminal. As soon as the PowerShell.exe file is opened, the code will run in the background and the terminal is displayed instantly.
Once the PowerShell.exe file is executed, a PowerShell terminal will be opened. PowerShell terminal can be used to automate various tasks using the commands. PowerShell has built-in support for thousands of cmdlets, functions, and aliases. Moreover, PowerShell can also run the cmd commands as well.
How to run PowerShell.exe
PowerShell.exe file can be executed from the command prompt, Run, and by locating the PowerShell.exe file manually. Let’s run the PowerShell.exe file by following the above-stated methods.
How to run PowerShell.exe from command prompt
Cmd (command prompt) is the basic command-line interface available on Windows-based operating systems. It can be used to perform various windows operations through commands. Here, we will use it to run PowerShell.exe
Launch the cmd (command prompt) from the search option of start menu.
The following command will execute the PowerShell.exe file from the command prompt:
The output shows that the command prompt window has now activated a PowerShell session.
- You can execute the PowerShell.exe file to start the new PowerShell session via the following command:
It is observed that a new dedicated window of PowerShell is opened.
How to run PowerShell.exe from the ‘Run’ command
Run command is a utility to open folders, files, programs, and applications by using their exact path or the name. The ‘Run’ command can also be used to run the PowerShell.exe by following the below-mentioned steps.
Step 1: Open the ‘Run’ by using the shortcut key ‘Windows-Key+R’.
Step 2: Type the below-mentioned command and hit enter:
The PowerShell will be launched with the currently logged-in user as shown below:
How to locate and run the PowerShell.exe file
Apart from executing the PowerShell.exe from command line methods, you can trace the PowerShell.exe file manually and run it.
Step 1: First, you need to navigate to the following directory (PowerShell.exe resides here).
Step 2: Scroll down the directories list and locate the PowerShell.exe file. Upon opening it, the PowerShell session will be started.
Moreover, right-click and choose ‘Run as Administrator’ for admin privileges.
How to use the PowerShell.exe
As discussed earlier, PowerShel.exe is the executable file of the PowerShell. Once the PowerShell is launched, you can perform thousands of operations by using its set of commands. We have listed a few cmdlets that are frequently used in PowerShell.
You can get available cmdlets/functions/aliases as follows:
To get all the processes, either stopped or running:
To print the services on your system:
To get the history of commands:
Here you go with the PowerShell.exe!
Conclusion
PowerShell.exe is the executable file of the PowerShell which is an advanced level command-line application. PowerShell.exe can be executed from the command prompt, the ‘Run’ command, and from the location of PowerShell.exe. You have learned the purpose, work, and usage of PowerShell.exe.