mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Fixed USBDriveList json formatting
This commit is contained in:
@@ -186,13 +186,9 @@ function Get-UIConfig {
|
|||||||
$installApps = $window.FindName('chkInstallApps').IsChecked
|
$installApps = $window.FindName('chkInstallApps').IsChecked
|
||||||
|
|
||||||
# Add USB drive selection to config
|
# Add USB drive selection to config
|
||||||
$selectedUSBDrives = $window.FindName('lstUSBDrives').Items | Where-Object { $_.IsSelected } | ForEach-Object {
|
$selectedUSBDrives = @{}
|
||||||
@{
|
$window.FindName('lstUSBDrives').Items | Where-Object { $_.IsSelected } | ForEach-Object {
|
||||||
Model = $_.Model
|
$selectedUSBDrives[$_.Model] = $_.SerialNumber
|
||||||
SerialNumber = $_.SerialNumber
|
|
||||||
DeviceID = $_.DeviceID
|
|
||||||
Size = $_.Size
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build configuration hashtable (unsorted)
|
# Build configuration hashtable (unsorted)
|
||||||
@@ -851,10 +847,8 @@ $btnLoadConfig.Add_Click({
|
|||||||
|
|
||||||
# Then select the drives that match the saved configuration
|
# Then select the drives that match the saved configuration
|
||||||
foreach ($item in $script:lstUSBDrives.Items) {
|
foreach ($item in $script:lstUSBDrives.Items) {
|
||||||
if ($configContent.USBDriveList | Where-Object {
|
if ($configContent.USBDriveList.ContainsKey($item.Model) -and
|
||||||
$_.Model -eq $item.Model -and
|
$configContent.USBDriveList[$item.Model] -eq $item.SerialNumber) {
|
||||||
$_.SerialNumber -eq $item.SerialNumber
|
|
||||||
}) {
|
|
||||||
$item.IsSelected = $true
|
$item.IsSelected = $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user