Create the VM, then add the virtual TPM before the first start.
Hyper-V host
$vm = "CON-WS-001" $root = "D:\VMs" $iso = "D:\ISOs\Windows11.iso" New-VM -Name $vm -Generation 2 -Path $root ` -MemoryStartupBytes 4GB ` -NewVHDPath "$root\$vm\$vm.vhdx" -NewVHDSizeBytes 70GB ` -SwitchName "CON-LAN" Set-VMProcessor -VMName $vm -Count 2 Set-VMMemory -VMName $vm -DynamicMemoryEnabled $false -StartupBytes 4GB Set-VM -Name $vm -CheckpointType Disabled Set-VMKeyProtector -VMName $vm -NewLocalKeyProtector Enable-VMTPM -VMName $vm Add-VMDvdDrive -VMName $vm -Path $iso Set-VMFirmware -VMName $vm -FirstBootDevice (Get-VMDvdDrive -VMName $vm)
| Line | What it does |
|---|---|
| Set-VMKeyProtector | Creates a key on this host that protects the VM's TPM. |
| Enable-VMTPM | Gives the VM its virtual TPM. |
The TPM key lives on this host
A VM with a virtual TPM will not start on another host unless you export it properly. Plan for that before you turn on BitLocker inside the VM.
Put it on the client VLAN
Hyper-V host
Set-VMNetworkAdapterVlan -VMName "CON-WS-001" -Access -VlanId 50
Done when
Check
Get-VMSecurity CON-WS-001 shows TpmEnabled True.


