Want to hear your thoughts on my approach here: We have sporadic issues where a person will be imaging and it will error out on Apply Operating System and the reason being is the BootDrive Partition get the letter c: and OSDISK gets letter d: but usually after a re-attempt this usually resolve... I believe this is because after a reboot WINPE just assigns first drive letter and so on. I am trying to prevent this. (Task Sequence below) - Possible Script to resolve this issue below that... What are your thoughts?
<# Get Partitions and set Drive Letters Properly, then Create Variable SCCM Tast Sequence Variable #> $Volume = get-volume $VolumeCheck = get-volume FOREACH ($Drive in $Volume){ $Label = $Drive.FileSystemLabel $DriveLetter = $Drive.DriveLetter IF ($Label -eq "Windows" -AND $DriveLetter -ne "C"){ #check to see if C is in use FOREACH ($DriveCheck in $VolumeCheck){ $LabelCheck = $DriveCheck.FileSystemLabel $DriveLetterCheck = $DriveCheck.DriveLetter if($DriveLetterCheck -like "C"){ #Change whatever was used by C to E set-partition -DriveLetter C -NewDriveLetter T } } #Set Windows to C set-partition -DriveLetter $DriveLetter -NewDriveLetter C } }