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:
cproudlock
2026-05-27 12:20:37 -04:00
parent 5e13d38512
commit 9b46d0279f

View File

@@ -28,7 +28,7 @@ function Read-BayList {
if (-not (Test-Path -LiteralPath $Path)) { return @() } if (-not (Test-Path -LiteralPath $Path)) { return @() }
try { try {
return Import-Csv -LiteralPath $Path | 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 Sort-Object -Property asset_tag -Descending
} catch { } catch {
return @() return @()
@@ -51,7 +51,7 @@ function Show-Menu {
Write-Host "" Write-Host ""
for ($i = 0; $i -lt $Items.Count; $i++) { for ($i = 0; $i -lt $Items.Count; $i++) {
$item = $Items[$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) { if ($i -eq $Selected) {
Write-Host (" > " + $line) -ForegroundColor Black -BackgroundColor White Write-Host (" > " + $line) -ForegroundColor Black -BackgroundColor White
} else { } else {