PowerShell$PSVersionTable

PowerShell$PSVersionTable,powershell,powershell-2.0,powershell-1.0,powershell-3.0,Powershell,Powershell 2.0,Powershell 1.0,Powershell 3.0,我已经安装了PowerShell 3.0,我希望模拟v1.0 当我使用-1$PSVersionTable报表启动PowerShell 3.0时: 名称值 -------- CLR版本2.0.50727.5456 构建版本6.1.7601.17514 PS2.0版 WSManStackVersion2.0 PSCompatibleVersions{1.0,2.0} 序列化版本1.1.0.1 PSRemotingProtocol2.1版 如果使用-Version 2参数,则得到相同的结果 如果使用-

我已经安装了PowerShell 3.0,我希望模拟v1.0

当我使用-1$PSVersionTable报表启动PowerShell 3.0时:

名称值
--------
CLR版本2.0.50727.5456
构建版本6.1.7601.17514
PS2.0版
WSManStackVersion2.0
PSCompatibleVersions{1.0,2.0}
序列化版本1.1.0.1
PSRemotingProtocol2.1版

如果使用-Version 2参数,则得到相同的结果
如果使用-Version 3参数,则得到版本3


问题,为什么我不能模仿版本1?

看看,我不认为你可以在不做GAC手术的情况下运行1和2并排运行(因此,1、2和3也不是共存的-只有2和3,因为2和3是并排运行的)。版本2是为了完全取代版本1,AFAICT。

您不能使用并排的东西运行V1。这一点从未得到支持。您可以从V3运行V2,但不能从V1运行。

我理解您的逻辑,它确认了我看到的内容。我刚刚尝试了PowerShell 2的版本1。它报告为版本2!