在System.Management.Automation没有PowerShell的?

编程入门 行业动态 更新时间:2024-10-28 12:24:11
本文介绍了在System.Management.Automation没有PowerShell的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有麻烦了的PowerShell 类来解决。我在this问题。

I'm having trouble getting the PowerShell class to resolve. I'm following along with the example in this question.

我已经加入到 System.Management.Automation 引用从 C:\ Program Files文件\参考大会\微软\ WindowsPowerShell \ V1.0 \ System.Management.Automation.dll

我有使用System.Management.Automation; 包括在我的班上名列前茅

I have using System.Management.Automation; included at the top of my class.

然而,当我尝试创建的PowerShell的一个实例:的PowerShell PS = PowerShell.Create(),的PowerShell 将无法解决。

However, when I try to create an instance of powershell: PowerShell ps = PowerShell.Create(), PowerShell won't resolve.

使用 CTRL + 可自动添加完全限定的命名空间(或using语句)只是表明 Microsoft.P​​owershell 在的PowerShell 。

Using ctrl+. to auto-add the fully-qualified namespace (or using statement) just suggests Microsoft.Powershell in place of PowerShell.

我很困惑,为什么发生这种情况,因为即使列入上的PowerShell类 MSDN文档有pretty的多正是我。

I'm very confused why this is happening as even the example included in the MSDN documentation on the PowerShell class has pretty much exactly what I have.

我在.NET 3.5,Visual Studio 2010中,和Windows Server 2008 R2

I am in .NET 3.5, Visual Studio 2010, and Windows Server 2008 R2

推荐答案

PowerShell的类是新来的PowerShell 2.0。确保你引用2.0版本SMA.dll的。你有PowerShell的2.0安装?

The PowerShell class is new to PowerShell 2.0. Make sure you're referencing the 2.0 version of SMA.dll. Do you have PowerShell 2.0 installed?

更多推荐

在System.Management.Automation没有PowerShell的?

本文发布于:2023-11-08 22:23:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1570611.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Management   System   PowerShell   Automation

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!