Getting enums from imported .net core dll in powershell

Welcome Forums General PowerShell Q&A Getting enums from imported .net core dll in powershell

Viewing 0 reply threads
  • Author
    Posts
    • #192469
      Participant
      Topics: 1
      Replies: 0
      Points: -5
      Rank: Member

      I'm trying to load enums from a .netcore dll that I imported in powershell. I tried many actions:

      [Reflection.Assembly]::LoadFrom(dllPath)
      Add-Type -Path dllpath
      [Reflection.Assembly]::Load(dllPath)

      and then called: [MyEnum]::enumName

      I got this Exception :

      Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system 
      cannot find the file specified.

      Can you please let me know if I'm missing anything. How to get these enums ?

      Thanks,

Viewing 0 reply threads
  • You must be logged in to reply to this topic.