none
Where is System.Management.Automation?

    Question

  • 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

    http://www.wapshere.com/missmiis
    Tuesday, November 04, 2008 9:53 AM

Answers

  • 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

    http://www.wapshere.com/missmiis
    Tuesday, November 04, 2008 10:24 AM

All replies

  • 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

    http://www.wapshere.com/missmiis
    Tuesday, November 04, 2008 10:24 AM
  • 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.
    Tuesday, November 04, 2008 10:25 AM
    Moderator
  • 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.

    Tuesday, July 28, 2015 4:48 AM
  • 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


    \_(ツ)_/

    Tuesday, July 28, 2015 11:59 AM