poshprotools icon indicating copy to clipboard operation
poshprotools copied to clipboard

Usage of -Property/-Properties of Grids/Tables

Open kort3x opened this issue 7 years ago • 5 comments
trafficstars

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.

kort3x avatar Dec 29 '17 18:12 kort3x

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.

adamdriscoll avatar Dec 31 '17 15:12 adamdriscoll

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.

kort3x avatar Dec 31 '17 16:12 kort3x

Oh, I see. Sure. I like that as well. Best to be consistent.

adamdriscoll avatar Dec 31 '17 16:12 adamdriscoll

On the other hand the Table-Style seems more consistent with the Powershell approach of splitting up data production and data formating/displaying.

kort3x avatar Dec 31 '17 16:12 kort3x

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

kort3x avatar Dec 31 '17 16:12 kort3x