blue-byte-31678
12/15/2025, 8:33 PMtall-airline-16756
12/15/2025, 8:33 PMtall-airline-16756
12/15/2025, 8:34 PMblue-byte-31678
12/15/2025, 8:35 PMtall-airline-16756
12/15/2025, 8:35 PMlk agent list. Below is a concise PowerShell snippet that captures that output, extracts the first column (Agent ID) and stores IDs in `$agentIds`:
# run command and keep only table lines that contain column separators
$tableLines = lk agent list | Where-Object { $_ -match '│' }
$agentIds = @()
foreach ($line in $tableLines) {
# normalize spacing and split on the column separator
$cols = ($line -replace '^\s*│\s*','' -replace '\s*│\s*$','') -split '│'
# first column is the ID; trim and skip header/border rows
$id = $cols[0].Trim()
if ($id -and $id -ne 'ID') { $agentIds += $id }
}
# show collected IDs
$agentIds
If your lk output uses different characters or spacing, paste a sample of the output and I’ll adjust the parser. Would you like the IDs as a comma string or kept as an array?
Sources: Agent deployment CLI reference | LiveKit docs