Where is System.Management.Automation?
I need to run some powershell commands from VB.NET code. Apparently I should Import System.Management.Automation - however it is not found.

Powershell is installed.This MSDN page mentions system.management.automation.dll, however searching for this file finds nothing.

Where is this library?

Thanks,
Carol
November 4th, 2008 9:53am

Doesn't matter - I found a useful comment on a blog somewhere. You have to run this:

C:\windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll C:\

Then open it in Visual Studio Version Selector (whatever that is - it just came up as the recommended app), then use Save As to save the dll to the location of oyur choice.

How convoluted is that??

Carol
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2008 10:24am

Here's a trick to find it from within PowerShell:
$ref=[psobject].assembly.location

Now, the proper/best practices way is to go and get the latest Windows SDK, but the above will work also.
November 4th, 2008 10:25am

I know this is a very delayed reply, but I too was following the "getting started" for Powershell Providers, and step 1 just says "Add the System.Management.Automation assembly as a reference to your project."

Searching Google, this was the second hit still, so I thought I'd mention that I was able to find the Powershell 3.0 version of this assembly in NuGet. 

Manage NuGet Packages... > search for System.Management.Automation -> look for package with description "... for PowerShell 3.0"

Hope this helps someone else too!

Cheers.

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 12:56am

Thread is closed.  You are still searching in the wrong forum for support with Visual Studio projects.

The issue is that you install the SDK on the development machine but you have to be careful about references set in code as the reference DDLL is not required once the project is built.

To learn how to use VS and reference assemblies please post your specific issue to the MSDN Visual Studio forum.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=visualstudio

July 28th, 2015 8:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics