问题描述
有谁知道为什么 Powershell 2.0 安装在 Windows 7 机器上的 C:WindowsSystem32WindowsPowerShellv1.0 中?
Does anyone know why Powershell 2.0 is installed in C:WindowsSystem32WindowsPowerShellv1.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 安装在同一位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!