Blog Post

Where do I find System.Management.Automation

Thursday, March 16, 2017 2:19 PM

While working on sample code in C# downloaded from GitHub, I came across following

using System.Management.Automation;

The purpose of the DLL is to support power shell run time. This means I need to add reference to that in order to be able to use it. When I open my system references I could not find it. In order to resolve it I have found two solutions.

1. Using nuget.org and install package

Install-Package System.Management.Automation

2.  Use local GAC

Your GAC on your PC might provide you alternative solution is

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

 Obviously my preference is the nuget.org source, as it is owned by the PowerShell team, but if you cannot access nuget.org, its nice to have backup location.

 

 

 

Blog
Products
Error pages
Links and tools