select-waxtrace-asset: fix blank serial/probe columns in bay picker
The picker was reading unit_serial and probe_part from the old INDEX.csv format. bay-config.csv uses different column names (ftpak_version, model, host). Updated Select-Object and display format to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,7 @@ function Read-BayList {
|
||||
if (-not (Test-Path -LiteralPath $Path)) { return @() }
|
||||
try {
|
||||
return Import-Csv -LiteralPath $Path |
|
||||
Select-Object -Property asset_tag, unit_serial, probe_part |
|
||||
Select-Object -Property asset_tag, ftpak_version, model, host |
|
||||
Sort-Object -Property asset_tag -Descending
|
||||
} catch {
|
||||
return @()
|
||||
@@ -51,7 +51,7 @@ function Show-Menu {
|
||||
Write-Host ""
|
||||
for ($i = 0; $i -lt $Items.Count; $i++) {
|
||||
$item = $Items[$i]
|
||||
$line = if ($item -is [string]) { $item } else { "{0,-10} serial={1,-12} probe={2}" -f $item.asset_tag, $item.unit_serial, $item.probe_part }
|
||||
$line = if ($item -is [string]) { $item } else { "{0,-10} v{1,-6} {2,-10} {3}" -f $item.asset_tag, $item.ftpak_version, $item.model, $item.host }
|
||||
if ($i -eq $Selected) {
|
||||
Write-Host (" > " + $line) -ForegroundColor Black -BackgroundColor White
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user