Path to Powershell.exe (v 2.0)

Where is Powershell located (version 2.0)? What is the path to Powershell.exe? I have installed Windows Server 2008 and Powershell. When I look at this folder:

PS C:\Windows\System32\WindowsPowerShell> dir Directory: C:\Windows\System32\WindowsPowerShell Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 20.4.2010 17:09 v1.0 

I have only Powershell v1.0. But when I type

 PS C:\> $Host.version Major Minor Build Revision ----- ----- ----- -------- 2 0 -1 -1 PS C:\> 

This shows that I have v2.0 installed.

+101
powershell path
Nov 10 2018-10-10
source share
5 answers

I believe this in C:\Windows\System32\WindowsPowershell\v1.0\ . To confuse the innocent, MS stored it in a directory labeled "v1.0". Doing this on Windows 7 and checking the version number using $Host.Version ( determine the installed version of PowerShell ) shows it 2.0.

Another option is to enter $PSVersionTable at the command prompt. If you are working with version 2.0, the output will be:

 Name Value ---- ----- CLRVersion 2.0.50727.4927 BuildVersion 6.1.7600.16385 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0} SerializationVersion 1.1.0.1 PSRemotingProtocolVersion 2.1 

If you are working with version 1.0, the variable does not exist and there will be no output.

Localization of PowerShell version 1.0, 2.0, 3.0, 4.0:

  • 64-bit: C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \
  • 32-bit version: C: \ Windows \ SysWOW64 \ WindowsPowerShell \ v1.0 \
+151
Nov 10 2018-10-10
source share

I think $ PsHome has the information you are looking for?

 PS.> $ PsHome
 C: \ Windows \ System32 \ WindowsPowerShell \ v1.0

 PS.> Get-Help about_automatic_variables

 TOPIC
     about_Automatic_Variables ...

+43
Jun 19 '12 at 12:01
source share

Here is one way ...

 (Get-Process powershell | select -First 1).Path 

Perhaps this is the best way, as it returns the first hit on the path, just as if you were launching Powershell from the command line ...

 (Get-Command powershell.exe).Definition 
+24
Nov 02 2018-11-11T00:
source share

It is always C: \ Windows \ System32 \ WindowsPowershell \ v1.0. It was so that for backward compatibility this is what I heard or read somewhere.

+11
Nov 10 2018-10-10
source share

Do you know where the official PowerShell page is located, indicating that it is always: "C: \ Windows \ System32 \ WindowsPowershell \ v1.0"?

0
Apr 21 '19 at 13:01
source share



All Articles