使用WMI C ++读取hyperv 2016 VMCX [英] Reading hyperv 2016 VMCX using WMI C++

查看:288
本文介绍了使用WMI C ++读取hyperv 2016 VMCX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何使用WMI C ++读取VM配置文件(VMCX)。

类似于编辑.VMCX文件Ben Armstrong的虚拟化博客 [ ^ ]





我发现的大部分文件都在c#或powershell中。

在C ++中有类似的东西我可以使用object.GetRelated()关联吗?



提前致谢。



我尝试了什么:



尝试使用powershell脚本(如上文所述)或使用compare-vm命令。无法在C ++中获得关联。

Hi,
How to read the VM configuration file (VMCX) using WMI C++.
Something similar to Editing a .VMCX file | Ben Armstrong’s Virtualization Blog[^]


Most of the documents i find are in c# or powershell.
Is there something similar in C++ where i can use object.GetRelated () association ?

Thanks in advance.

What I have tried:

Tried with powershell script (as mentioned in the above doc) or using the compare-vm command. Not able to get the association in C++.

推荐答案

我看到了这些可能的解决方案:



a)你可能是在c#中编写一个小型控制台应用程序,它解析文件并将数据写入C ++代码的文本文件中。

b)用C ++中的一些xml-parser解析vmcx文件。

c)用C ++编写一些字符串搜索(有点hacky)

d)高级:在C ++中使用C#

e)advanced 在C ++中使用powershell



正确的方法是e)。如果你这样做,请在结果上写一篇文章。我认为,a)将是最简单的方式,而且c)有点讨厌。
I see these possible solutions:

a) you could be to write a small console app in c# which parses the file and write the data in a text file for your C++ code.
b) you parse the vmcx-file with some xml-parser in C++.
c) write some string search in C++ (a bit hacky)
d) advanced: use C# in C++
e) advanced use powershell in C++

The correct way would be e). If you do it, please write your results a article. I think, that a) would be the easiest way and c) a bit nasty.


这篇关于使用WMI C ++读取hyperv 2016 VMCX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆