title: How to use Microsoft.Management.Infrastructure (MMI) instead of System.Management for local WMI queries
body: <p>I have this snippet for getting Windows Version using WMIC</p>
  
  <pre><code>(from x in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem").Get().OfType&lt;ManagementObject&gt;()
                      select x.GetPropertyValue("Version")).FirstOrDefault().ToString();
  </code></pre>
  
  <p>As the WMI is considered now legacy and <a href="https://github.com/dotnet/corefx/issues/37949" rel="nofollow noreferrer">.NET Core implementation of System.Configuration requires up-to-date .NET Framework</a>, it seems this information needs to be retrieved using MMI. </p>
  
  <p>Surprisingly, every Windows problem that requires WMI access has something like the snippet above. Looks like MMI adoption isn't that high yet and it's not easy to find a good MMI examples.</p>
  
  <p>How can I use <code>Microsoft.Management.Infrastructure</code> to accomplish the code above?</p>