Use wmic (or script it with wmi yourself).Use the command
wmic baseboard get manufacturer,product and check the values there.
If manufacturer reads Microsoft (or vmware or Oracle), its likely a vm, with the VM host being named as the product. I don't currently have a hyper V box, but virtualbox identifies itself as being manufactured by oracle, and virtualbox as the product.
My laptop has Lenovo as the manufacturer, and the full SKU as the model. You'll likely find similar behaviors between VM software, and actual hardware. My desktop has Asustek as the manufacturer and the motherboard model as the product
This should be sufficient to work out if your system is in a VM or not.