使用的PowerShell与.NET 3.5运行时/库 [英] Using PowerShell with .NET 3.5 runtime/libraries

查看:313
本文介绍了使用的PowerShell与.NET 3.5运行时/库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以运行PowerShell的1.0(或2.0 CTP)由3.5运行时,而不是2.0的支持?

Is it possible to run PowerShell 1.0 (or 2.0 CTP) backed by the 3.5 runtime instead of 2.0?

我们正在构建一个.NET 3.5的解决方案,而且我还是喜欢使用PowerShell作为我们的脚本引擎的计划任务等。

We're building a .NET 3.5 solution, and I'd still like to use PowerShell as our scripting engine for scheduled tasks, etc.

我不需要LINQ的语法或什么,只是3.5库和运行。

I don't need LINQ syntax or anything, just the 3.5 libraries and runtime.

跟帖:感谢您对动态加载程序集的答复。但是,让我澄清我的问题:有没有什么办法来运行PowerShell的,使得3.5库在默认情况下运行?所以,如果我进入新对象System.Xml.XmlDocument ,例如,我确实得到3.5版本的默认?

FOLLOWUP: thank you for the reply about dynamically loading assemblies. But let me clarify my question: is there any way to run PowerShell so that the 3.5 libraries run by default? So that if I enter New-Object System.Xml.XmlDocument, for example, I'm actually getting the 3.5 version by default?

半相关的问题:如果我的执行的有动态加载,比如,从3.5 的System.Xml 库,将它的重叠的现有的符号定义,使得的下一步的时候,我键入新对象System.Xml.XmlDocument ,它的的加载3.5版本?

Semi-related question: if I do have to dynamically load, say, the System.Xml library from 3.5, will it overlay the existing symbol definitions such that the next time I type New-Object System.Xml.XmlDocument, it will load the 3.5 version?

推荐答案

如果您在系统上安装有3.5,也就是当你运行PowerShell的你会得到。

If you have 3.5 installed on your system, that is what you'll get when you run PowerShell.

PowerShell是唯一的需要安装的时候2.0,但3.0和3.5的兼容性,以及autoforward。在PowerShell的V2,我们实际上看,看看有什么版本,就和亮起来的某些功能(如PowerShell_ISE和Out-GridView控件可当你有3.51)。

PowerShell is only "requires" 2.0 but 3.0 and 3.5 are compatible and autoforward when installed. In PowerShell V2, we actually look to see what version you have and "light up" certain features (e.g. PowerShell_ISE and Out-GridView are available when you have 3.51).

实验!享受!搞!

杰弗里Snover [MSFT] Windows管理合伙人建筑师

Jeffrey Snover [MSFT] Windows Management Partner Architect

这篇关于使用的PowerShell与.NET 3.5运行时/库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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