Powershell: align right for a column value from Select-Object in Format-Table format
- by David.Chu.ca
I have the following array value $outData with several columns. I am not sure how I align some columns right?
$outData | Select-Object `
Name `
@{Name="Freespace(byte)"; Expression={"{0:N0}" -f $_.FreeSpace}}, '
.... # other colums `
| Format-Table -AutoSize
It works fine. However, when I tried to use align for the freespace column to right:
@{Name="Freespace(byte)"; Expression={"{0:N0}" -f $_.FreeSpace}; align="right"}, '
I got error message "Specified method is not supported". Not sure if there is any way to align the value to right?