如何以编程方式获取 HyperV Notes 字段

How to get HyperV Notes field programmatically

我使用 Hyper-V 管理器为虚拟机的注释字段添加了一个值。

如何以编程方式获取备注字段中的值?

我可以使用 WMI classes 和属性获取值吗?

我试图通过 Msvm_ComputerSystem class 获取值,但找不到任何 属性 注释。

Hyper-V Powershell cmdlets use the Msvm_VirtualSystemSettingData WMI class. In that class there is a Notes member that can be read. It's read-only; but can be modified via ModifyVirtualSystem method on Msvm_VirtualSystemManagementService.