A Microsoft file hosting and synchronization service.
Hello Kittipong And
Thanks for posting your concerns in Microsoft Community.
I am aware of the present situation is that you have delete the files on OneDrive Online, but the size of your OneDriveTemp folder does not decrease.
Your understanding is correct, the use of Personal Vault does create a .vhdx disk in the OneDriveTemp folder, Personal Vault is a VHDX based folder roaming solution, the user's Personal Vault files will be in this VHDX disk Vault if you have it open on the desktop or use Personal Vault. Then the VHDX disk will be created in the OneDriveTemp folder, but if you do not open the personal vault, the VHDX disk will not be generated.
Regarding your question, do you need to use Optimize-VHD (Hyper-V) | Microsoft Learn to reduce the space occupied by the VHDX virtual hard disk? In theory, the optimized VHD mentioned in this article is applicable to the Windows operating system in Hyper-V. As I mentioned before, the VHDX hard disk generated by OneDrive is a behavior by design. If you need to optimize hard disk space . Please do as follows:
If you need to free up the space occupied by the VHDX disk, I suggest that you do not open the personal vault first, then locate the VHDX disk and delete it. Then the VHDX disk will not be generated again. After my test, this will not affect the data in the personal vault. Of course, I also recommend that you export and backup some important data.
Feel free to post back here if any updates.
Chandy | Microsoft Community Support Specialist