tabs-not-spaces / Intune.USB.Creator

A module containing tools to assist with the creation of a bootable WinPE USB used to provision devices for enrollment to Intune.
GNU General Public License v3.0
131 stars 43 forks source link

Added logic to detect proper DiskID for system disk and USB stick #34

Closed rawIce closed 3 years ago

rawIce commented 3 years ago

Hello,

referring to #30 I implemented some logic in order to determine the actual DiskID for the system disk and the USB stick to be used in the appropriate diskpart scripts. Previously those values have been hard coded.

Behaviour The logic assumes, that the DeviceID property from diskpart and from Get-PhysicalDevice PowerShell cmdlet are the same. In my test scenarios this has been the case.

When there is only one physical disk detected which is connected via USB and one device which is not USB, the corresponding DiskIDs are mapped automatically.

In case there is more than one disk, the user has to choose where Windows should be installed. However due to a lack of devices with more than one internal disk I was not able to test this part of the script.

tabs-not-spaces commented 3 years ago

merging this now.