Reputation: 175
So, I've been trying my hand at powershell automation of Hyper-V VM administration, and I can't seem to find a reliable way to find the VM Data Root for a given VM. I understand that when programmatically building one, I set it via the Msvm_VirtualSystemGlobalSettingData WMI class. How do I access this class post VM creation?
Thanks!
Upvotes: 1
Views: 749
Reputation: 4123
The GetRelated() method is the key:
PS C:\> $vm = gwmi -namespace root\virtualization Msvm_ComputerSystem -filter 'ElementName="SomeVM"'
PS C:\> $vm.GetRelated("Msvm_VirtualSystemGlobalSettingData")
Upvotes: 1