poshprotools
poshprotools copied to clipboard
Usage of -Property/-Properties of Grids/Tables
When grids are used you have to pass -properties to New-UDGrid. When tables are used you have to pass -property to Out-UDTableData.
Is there a reason for this or could tables be changed to the usage of grids? Would break existing scripts but seems more logical in the long run.
I agree. I hadn't noticed that discrepancy. PowerShell best practice says to use singular nouns so I will change New-UDGrid to Property but I will include an Alias for Properties for the time being. It won't break existing scripts but I will deprecate it's usage and remove it in 2.0.
It's not only the singular thing. For grids you define the properties and headers in New-UDGrid while for Tables it is split up. Here headers are defined in New-UDTable while the Properties are defined in Out-UDTableData.
Me personally prefer the Grid-Style.
Oh, I see. Sure. I like that as well. Best to be consistent.
On the other hand the Table-Style seems more consistent with the Powershell approach of splitting up data production and data formating/displaying.
I could see a case where you get data from different sources which you want to match up by using different properties on out-tabledata but same headers on new-udtable.
Edit: Of course one could use select-object to match up data before piping it to out-tabledata. I dont know... maybe I am just nitpicky