EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials PowerShell Tutorial PowerShell Executable Location
Secondary Sidebar
PowerShell Tutorial
  • Functions
    • PowerShell Functions
    • PowerShell String Functions
    • powershell nslookup
    • PowerShell here string
    • PowerShell Wildcards
    • Regex in PowerShell
    • PowerShell not like
    • PowerShell Filter
    • PowerShell Sleep
    • PowerShell where
    • PowerShell join string
    • PowerShell Exit
    • PowerShell null
    • PowerShell Dictionary
    • PowerShell Location
    • PowerShell Start-Service
    • PowerShell is not digitally signed
    • PowerShell Uptime
    • PowerShell Create Directory
    • PowerShell Trim
    • PowerShell Join-Path
    • PowerShell Execution Policy
    • PowerShell SubString
    • PowerShell Format Table
    • PowerShell Import Module
    • PowerShell ForEach Object
    • PowerShell Alias
    • PowerShell Scheduled Task
    • PowerShell Convert String to Date
    • PowerShell Split String
    • PowerShell Multiline String
    • PowerShell MultiLine Comment
    • PowerShell Rename Folder
    • PowerShell Delete Folder
    • PowerShell String Replace
    • PowerShell join
    • PowerShell xcopy
    • PowerShell Base64
    • PowerShell Tail
    • PowerShell User List
    • PowerShell remove User from group
    • PowerShell JSON Format
    • PowerShell Send Mail
    • PowerShell Convert to String
    • PowerShell Start-Process
    • PowerShell change directory
    • PowerShell Open File
    • PowerShell Batch File
    • PowerShell ZIP
    • PowerShell unzip
    • PowerShell XML
    • PowerShell XML Parsing
    • Remote PowerShell
    • PowerShell Escape Character
    • PowerShell scriptblock
    • PowerShell Executable Location
    • PowerShell Import-CSV?
    • PowerShell Export CSV
  • Basics
    • PowerShell Restart Service
    • PowerShell comment
    • PowerShell Map Network Drive
    • PowerShell Append to File
    • PowerShell print
    • What is PowerShell
    • Uses Of Powershell
    • PowerShell Empire
    • PowerShell Parameter
    • PowerShell Stop Service
    • PowerShell Versions
    • How To Install PowerShell
    • PowerShell uninstall module
    • How to Use PowerShell?
    • PowerShell Logging
    • PowerShell Tools
    • PowerShell Commands
    • PowerShell Version Command
    • PowerShell Administrator
    • PowerShell Modules
    • PowerShell Registry
    • PowerShell block Comment
    • PowerShell Verbs
    • PowerShell list
    • PowerShell add user to group
    • PowerShell Write to Console
    • Variable in PowerShell
    • PowerShell New Line
    • PowerShell prompt for input
    • PowerShell File Extension
    • Powershell Remotesigned
    • PowerShell Write to File
    • PowerShell Ping
    • PowerShell wget
    • PowerShell Global variable
    • PowerShell Get-ADGroup
    • Array in PowerShell
    • PowerShell Multidimensional Array
    • PowerShell Array of Strings
    • PowerShell? join array
    • Useful PowerShell Scripts
    • String in PowerShell
    • PowerShell Switch Statement
    • PowerShell Function Parameters
    • PowerShell vs PowerShell ISE
    • PowerShell test-connection
    • PowerShell Test-NetConnection
    • PowerShell GUI
    • PowerShell Variable in String
    • PowerShell Active Directory
  • Variables
    • PowerShell Variables
    • PowerShell Environment Variables
    • PowerShell set environment variable
    • Hashtable in PowerShell
    • Set Variable in PowerShell
  • Operators
    • PowerShell Operators
    • Comparison Operators in PowerShell
    • Logical Operators in PowerShell
    • PowerShell Boolean
    • PowerShell Like Operator
  • cmdlet
    • PowerShell Wait
    • PowerShell Match
    • cmdlets in PowerShell
    • Start PowerShell from cmd
    • Add-Content in PowerShell
    • Get Help in PowerShell
    • PowerShell Copy-Item
    • PowerShell Remove-Item
    • PowerShell Move-Item
    • Get Command in PowerShell
    • PowerShell Run Command
    • Windows PowerShell ISE
    • Windows Powershell Commands
    • WinRM PowerShell
    • PowerShell Date
    • Powershell Write-Host
    • PowerShell Get-ChildItem
    • PowerShell Sort-Object
    • PowerShell Where Object
    • PowerShell Set-Content
    • PowerShell Set-Location
    • PowerShell Invoke-Command
    • PowerShell Invoke-Webrequest
    • PowerShell Get-Location
    • PowerShell Get-Date
    • PowerShell Get-Service
    • PowerShell Test-Path
    • Powershell Module Path
    • PowerShell Out-File
    • PowerShell if File Exists
    • Powershell Copy File
    • PowerShell Delete File
    • PowerShell New-Item
    • PowerShell Rename-Item
    • PowerShell ComputerName
    • PowerShell Get-Content
    • PowerShell Get-Item
    • PowerShell Get-ADUser
    • PowerShell Grep
    • PowerShell Concatenate String
    • PowerShell Get-Process
    • PowerShell Count
    • PowerShell pause
  • Control Statements
    • If Statement in PowerShell
    • If Else in PowerShell
    • Else If in PowerShell
    • Loops in PowerShell
    • For loop in PowerShell
    • PowerShell While Loop
    • PowerShell do while
    • PowerShell Loop through Array
    • PowerShell add to array
    • PowerShell ForEach Loop
    • PowerShell Break
    • PowerShell Continue
    • Switch Case in PowerShell
    • PowerShell If-Not
    • Try-catch in PowerShell
  • Interview Questions
    • PowerShell Interview Questions

PowerShell Executable Location

By Priya PedamkarPriya Pedamkar

PowerShell Executable Location

Introduction to PowerShell Executable

PowerShell.exe is the executable file of the that is used by system administrator for configuration management and other task automation related activities. The .exe stands for an executable file. Some executable files possess a threat to the system but since Powershell.exe is a product of Microsoft there are no such harms associated with it. The executable file can execute both PowerShell cmdlets and scripts. This article will cover in detail the exe file of the PowerShell.

Syntax:

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

The following cmdlet can be used to identify the location of the exe file

(Get-Process -Id $pid).Path

the output will be as below

PowerShell Executable Location 1

The PowerShell.exe is a signed file by Microsoft and so it can be relatively assumed to be a safe file. The percentage of this file can be considered dangerous security-wise is 3%. The size of the file is 437 KB. The size of the PowerShell_Ise.exe is 208 KB.

Locations on 64-bit Operating Systems

The following are the locations on 64-bit operating systems.

  •  32-bit PowerShell.exe:

It is available in the following location.

%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

  •  64-bit Powershell.exe:

It is available in the following location.

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

  •  32-bit PowerShell_ISE.exe:

It is available in the following location.

%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe

  •  64-bit Powershell_ISE.exe:

It is available in the following location.

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell_ise.exe

Locations in 32-bit Operating Systems

The following are the locations in 32-bit operating systems.

  • 32-bit PowerShell.exe:

It is available in the following location.

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

  •  32-bit PowerShell_ISE.exe:

It is available in the following location.

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell_ise.exe

Starting from PowerShell version 6, it is referred as PowerShell core and it has been made open source and it uses the functionality of .net core. The binary file has been renamed as pwsh.exe in windows and pwsh in mac and linux.

Finding the PowerShell Location in the System

The below cmdlet can be used to find out the location of the exe.

Input:

(get-command PowerShell.exe).Path

Output:

PowerShell Executable Location 2

Syntax:

PowerShell[.exe]   [-PSConsoleFile <file> | -Version <version>]    [-NoLogo]    [-NoExit]    [-Sta]    [-Mta]    [-NoProfile]    [-NonInteractive]    [-InputFormat {Text | XML}]    [-OutputFormat {Text | XML}]    [-WindowStyle <style>]    [-EncodedCommand <Base64EncodedCommand>]    [-ConfigurationName <string>]    [-File - | <filePath><args>]    [-ExecutionPolicy <ExecutionPolicy>]    [-Command - | { <script-block> [-args <arg-array>] }     | { <string> [<CommandParameters>] } ]

 Parameters:

  • -PSConsoleFile <FilePath>:

This is used to load the file specified PS file in the console. To import, the name and the path of the PS file must be specified. To create a new one, the export-console cmdlet should be used.

  • -Version <PowerShell Version>:

This denotes the Powershell version that needs to be started. It can either be 2.0 or 3.0. However, the supplied version should be available on the system else an error will be thrown.

  • -NoLogo:

This is used to hide the banner while starting the PowerShell.

  • -NoExit:

This denotes the PowerShell to be not closed after running the cmdlets.

  • -STA:

This denotes that the PowerShell should be started using single-threaded concept. In PowerShell version 2.0, multi-threaded is the default whereas in PowerShell version 3.0 single threaded is the default.

  • -MTA:

This denotes that the PowerShell should be started using single-threaded concept. In PowerShell version 2.0, multi-threaded is the default whereas in PowerShell version 3.0 single threaded is the default.

  • -NoProfile:

This denotes that the PowerShell profile should not be loaded.

  • NonInteractive:

This denotes that a prompt shouldn’t be displayed to the user during execution.

  • -InputFormat {Text | XML}:

This specifies the format of input being sent to PowerShell. It can either be text or xml.

  • -OutputFormat {Text | XML}:

This specifies the format of output being sent from PowerShell.It can either be text or xml.

  • -WindowStyle <Window style>:

This denotes the style of the PowerShell window. The accepted values are Normal, minimized, maximized or hidden.

  • -ConfigurationName <string>:

This denotes the endpoint configuration of the PowerShell. This can be either default end point on the local machine or custom end point pertaining to user requirements.

  • -File – | <filePath><args>:

if “-“ is specified, standard input is considered. A normal session is started if the cmdlet is run without “-“. This is like running without the file param. On the off chance that the esteem of Record could be a record way, the script runs within the neighborhood scope (“dot-sourced”), so that the capacities and factors that the script makes are accessible within the current session. Record must be the final parameter within the command. All values written after the Record parameter are translated as the script record way and parameters passed to that script.Parameters supplied to the script are sent as strict strings, after translation by the current shell. For illustration, in case you’re in cmd.exe and need to pass an environment variable esteem, it is done in the following manner: powershell.exe -File .viki.ps1 -TestParam test. If the value is going to be a file path, it should be given at the end as the character that are specified after the parameter as treated as file path by default.

  • -ExecutionPolicy <ExecutionPolicy>:

This is used to set the current sessions default execution policy and it is being stored in the environment variable, $env:PSExecutionPolicyPreference. However, the value set in the registry is not affected because of this.

  • -Command:

This denotes the commands to be executed. This is like running the commands at the PowerShell window. To stop the execution, NOExit parameter must be set. The value of this parameter can either be a string or a script block. If the value is “-“, the value is read from standardized input. In case of value being a string, it should be specified at the end. The script block is considered only when triggered from another PowerShell exe.

Conclusion

Thus, the article explained in detail about the various locations of PowerShell executable file. It also explained in detail about PowerShell.exe along with its various parameters. It should be noted on how to trigger the PowerShell.exe from command prompt. To learn more in detail it is advisable to explore running files from Powershell.exe from cmd prompt.

Recommended Articles

This is a guide to PowerShell Executable Location. Here we discuss introduction to PowerShell Executable, various locations of PowerShell executable file. You can also go through our other related articles to learn more –

  1. PowerShell Export CSV
  2. PowerShell Count
  3. Remote PowerShell
  4. PowerShell Start-Process
Popular Course in this category
PowerShell Training (2 Courses, 1 Project)
  2 Online Courses |  1 Hands-on Project |   4+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Shell Scripting Training (4 Courses, 1 Project)4.9
All in One Data Science Bundle (360+ Courses, 50+ projects)4.8
Data Visualization Training (15 Courses, 5+ Projects)4.7
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more