Since I don't have an 8.0 environment handy, I hesitate to give you untested code, though I can tell you what you're looking for. The 8.0 powershell module will require some reflection to get at this property. We exposed this property in the 8.5 module.
The QVWComputer object returned by cmdlets such as Get-QVWComputer has a non-public backing object called the BusinessObject. This is where you will need to use reflection to gain access.
This BusinessObject has a public property named Template which has a great deal of information that might prove useful to you.
Right, ok, that's the System.Reflection.PropertyInfo that the GetProperties() reflection returned.
You can use that to actually access the object's data using .GetMethod().Invoke($machines[0], []) or something to that effect. That should invoke the Get on that property for the $machines[0] object, returning the actual BusinessObject behind the QVWComputer object.
Hilbert_nl
17 Posts
1526
0
Posted January 7th, 2016 06:00
Sorry, I couldn't get it work. In the near future we will run vW 8.6, I will try it again then.
For now I fixed it with CmdLets from HyperV 2012 R2
$VMTemplate = ((Get-VM -Name $VM).Id | Get-VHD).ParentPath
I split and convert this to the correct template name.