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