Skip to content

Commit

Permalink
Fix WMI access to use working namespace and VM identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
kariudo committed Oct 15, 2018
1 parent 9d76635 commit 5e5d3c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="root" value="\\.\root\virtualization"/>
<add key="root" value="\\.\root\virtualization\v2"/>
</appSettings>

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
2 changes: 1 addition & 1 deletion Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private static IEnumerable<ManagementObject> GetVMs()
foreach (var o in vmCollection)
{
var vm = (ManagementObject) o;
if (vm["AssignedNumaNodeList"] != null)
if (vm.Properties["Caption"].Value.ToString() == "Virtual Machine")
{
vms.Add(vm);
}
Expand Down
4 changes: 4 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ internal static class Program
[STAThread]
private static void Main()
{
#if DEBUG
while (!System.Diagnostics.Debugger.IsAttached)
System.Threading.Thread.Sleep(100);
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Expand Down

0 comments on commit 5e5d3c5

Please sign in to comment.