I'm having trouble getting the PowerShell
class to resolve. I'm following along with the example in this question.
I have a reference added to System.Management.Automation
from C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll
I have using System.Management.Automation;
included at the top of my class.
However, when I try to create an instance of powershell: PowerShell ps = PowerShell.Create()
, PowerShell
won't resolve.
Using ctrl+. to auto-add the fully-qualified namespace (or using statement) just suggests Microsoft.Powershell
in place of PowerShell
.
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.
I am in .NET 3.5, Visual Studio 2010, and Windows Server 2008 R2