Skip to content

Commit

Permalink
Fix params
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunLawrie committed Sep 23, 2024
1 parent 65d92e4 commit dfa4140
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PwshSpectreConsole/public/formatting/Format-SpectreTable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ function Format-SpectreTable {
'View' { $FormatTableParams.View = $View }
'Property' { $FormatTableParams.Property = $Property }
}
if ($Property.Count -eq 0) {
$FormatTableParams.Property = '*'
}
}
process {
foreach ($entry in $data) {
Expand All @@ -178,9 +181,9 @@ function Format-SpectreTable {
}
if ($FormatTableParams.Keys.Count -gt 0) {
Write-Debug "Using Format-Table with parameters: $($FormatTableParams.Keys -join ', ')"
$collector = $collector | Format-Table @FormatTableParams *
$collector = $collector | Format-Table @FormatTableParams
} else {
$collector = $collector | Format-Table *
$collector = $collector | Format-Table -Property *
}
if (-Not $collector.shapeInfo) {
# scalar array, no header
Expand Down

0 comments on commit dfa4140

Please sign in to comment.