[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 427
  • Last Modified:

Problem with Powershell references in Visual Studio

I have problems referencing powershell functions from within Visual Studio 2008 or 2010. I have imported the
System.Management.Automation.dll but it still cannot find references to:

        Dim connInfo As WSManConnectionInfo
        Dim mycommand As PSCommand, pscmd As PowerShell
        Dim ws As System.Management.Automation.Runspaces.run

Also it cannot find AuthenticationMechanism or RunspaceAvailability so I am unable to build the project

I tried removing and re-adding references with no luck.
I used to work ok before but it lost all the references for some reason. I even went back to an earlier version of the project.
I tried creating a new project with the appropriate references.

Are there different versions of System.Management.Automation.dll ?
 Mine is 6.0.6000.16386 dated 12/01/2007
0
Peter Hutchison
Asked:
Peter Hutchison
1 Solution
 
Peter HutchisonSenior Network Systems SpecialistAuthor Commented:
Resolved.

I reinstalled Windows SDK for Windows 7 and .NET 3.5 SP1 and updated the references.
The DLL has been updated to v6.1.7600 which has the appropriate references in it.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now