How do I get access to CimCmdlets in .NET Core when using System.Management.Automation?
问题 Goal I would like to have access to the cmdlets in the CimCmdlets module in .NET Core within C# code. Specifically, I want to be able to use the New-CimSessionOption and New-CimSession cmdlets. NuGet Packages Microsoft.NETCore.App v2.2.0 Microsoft.Powershell.SDK v6.2.2 Simple Demo using System; using System.Management.Automation; namespace ConsoleApp1 { class Program { static void Main(string[] args) { string str; using (var ps = PowerShell.Create()) { str = ""; var results = ps.AddScript(