为什么 Powershell 2.0 安装在与 Powershell 1.0 相同的位置? [英] Why is Powershell 2.0 installed in the same location as Powershell 1.0?

查看:24
本文介绍了为什么 Powershell 2.0 安装在与 Powershell 1.0 相同的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道为什么 Windows 7 机器上的 Powershell 2.0 安装在 C:\Windows\System32\WindowsPowerShell\v1.0 中?

Does anyone know why Powershell 2.0 is installed in C:\Windows\System32\WindowsPowerShell\v1.0 on a Windows 7 box?

推荐答案

这实际上是一个关于副作用的有趣故事.

It's actually an interesting story in side-effects.

Visual Studio 在其添加引用"对话框中有固定的程序集列表.
其他任何东西都必须浏览.开发人员倾向于在 Windows 目录中浏览此位置,其中 System.Management.Automation.dll(运行 PowerShell 的大部分内容的程序集)这绝对引用了这个位置.由于 PowerShell 不会有并行安装选项(就像 .NET 框架一样),可用的最佳选择是允许人们通过路径和 StrongName 继续引用相同的程序集,就像他们以前一样.

Visual Studio has a fixed list of assemblies in their "Add Reference" dialog.
Anything else has to be browsed for. Developers tended to browse for this location in the Windows directory, where System.Management.Automation.dll (the assembly that runs most of PowerShell lives) This made an absolute reference to this location. Since there wasn't going to be a side-by-side install option with PowerShell (as there is with the .NET framework), the best choice available was to allow people to keep referencing the same assembly, both by path and by StrongName, as they did before.

如果这个故事没有一直这样,那么所有在 PowerShell V1 之上编写的应用程序都必须为 V2 重新发布.

If this story hadn't have stayed this way, all applications written on top of PowerShell V1 would have to be re-released for V2.

这篇关于为什么 Powershell 2.0 安装在与 Powershell 1.0 相同的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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