Hi,
You don't need to do that to free up the unused space. If your virtual disk is dynamically expanding, you could just compact it. Open the Hyper-V Manager and select Edit Disk on the right, then locate your virtual disk and choose compact
Please refer to the below article for the details.
If your virtual disk is fixed, just convert it to dynamically expanding.
You'll have to shutdown your virtual machine before you do this.
Best Regards,
Ian
----------
Please remember to "Accept Answer" and upvote if the reply is helpful.