Look up the VHDX filename including the path.
In admin cmd
- diskpart
- select vdisk file="E:\EXAMPLE.vhdx"
- expand vdisk maximum=40000
- exit
Now mount the VHDX in Disk Management to expand the partition fully, remember to detach the VHDX.
The value 40000 will give 40GB