Hi,
It seems like you’re trying to format and partition a disk based on the size of the hard disk using Microsoft Deployment Toolkit (MDT). While MDT doesn’t directly support this through Query WMI, there are workarounds you can use.
One method is to create an extra partition in MDT and deploy a task sequence1. You can resize the Windows partition size either by specifying the size in GB or Percentage. For example, if you reserve 70% for the first partition of a hard drive with 100GB, in the second partition data, you will have 95% of the rest 100GB.
You can also use a PowerShell script to dynamically set the disk for Windows OS Deployment This can help avoid accidental formatting of USB disks.
Please remember to back up your data before making any changes to your disk partitions. If you need more detailed instructions, please let me know! 😊