Powershell.exe (v 2.0) 的路径 [英] Path to Powershell.exe (v 2.0)

查看:21
本文介绍了Powershell.exe (v 2.0) 的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Powershell(2.0 版)在哪里?Powershell.exe 的路径是什么?我安装了 Windows Server 2008 和 Powershell.当我查看此文件夹时:

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

PS C:WindowsSystem32WindowsPowerShell> dir


    Directory: C:WindowsSystem32WindowsPowerShell


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         20.4.2010     17:09            v1.0

我只有 Powershell 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:>

它表明我已经安装了 v2.0.

It shows that I have v2.0 installed.

推荐答案

我相信它在 C:WindowsSystem32WindowsPowershellv1.0 中.为了迷惑无辜,MS 将其保存在标有v1.0"的目录中.在 Windows 7 上运行它并通过 $Host.Version 检查版本号(确定已安装的 PowerShell 版本) 显示它是 2.0.

I believe it's in C:WindowsSystem32WindowsPowershellv1.0. In order to confuse the innocent, MS kept it in a directory labeled "v1.0". Running this on Windows 7 and checking the version number via $Host.Version (Determine installed PowerShell version) shows it's 2.0.

另一个选项是在命令提示符下键入 $PSVersionTable.如果您运行的是 v2.0,输出将是:

Another option is type $PSVersionTable at the command prompt. If you are running v2.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

如果您运行的是 1.0 版,则该变量不存在且不会有任何输出.

If you're running version 1.0, the variable doesn't exist and there will be no output.

本地化 PowerShell 版本 1.0、2.0、3.0、4.0:

Localization PowerShell version 1.0, 2.0, 3.0, 4.0:

  • 64 位版本:C:WindowsSystem32WindowsPowerShellv1.0
  • 32 位版本:C:WindowsSysWOW64WindowsPowerShellv1.0

这篇关于Powershell.exe (v 2.0) 的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆