EZOut icon indicating copy to clipboard operation
EZOut copied to clipboard

Example: `SelectionCondition` Multiple `TableControl` Need One Default TableRowEntry

Open mattcargile opened this issue 1 year ago • 4 comments

Example

(Write-FormatTableView -Property Name,ComputerName -Width 70,25  -ViewCondition { if($_.ComputerName) { $true } } -ViewTypeName compName ) + (Write-FormatTableView -Property Name -Width 70 )  | Write-FormatView -FormatXML { $_ } -TypeName 'Utility.InstalledSoftware' | Out-FormatData | Set-Content t.format.ps1xml

Links

I'm looking at this doc. I can't quite figure out how to use the -ViewCondition. I want to display ComputerName when I have the data and hide it when I don't have the data.

mattcargile avatar Jun 22 '24 08:06 mattcargile

I'm thinking now I need to do independent Write-FormatView with each Write-FormatTableView and then pipe into Out-FormatData.

mattcargile avatar Jun 22 '24 14:06 mattcargile

@mattcargile yeah, selection conditions are both overpowered and not ideally exposed yet (I've only come to realize just how overpowered they are fairly recently)

See #220

Open to thoughts on the ideal command format here.

StartAutomating avatar Jun 23 '24 19:06 StartAutomating

I want to display ComputerName when I have the data and hide it when I don't have the data.

With table formatting, this will be a little bit trickier.

Table formatting conditions require the same number of columns to exist in each possible condition.

As far as how to use the current implementation... you can pipe multiple objects with a -ViewCondition in, provided as least one has no view condition.

StartAutomating avatar Jun 23 '24 19:06 StartAutomating

I want to display ComputerName when I have the data and hide it when I don't have the data.

With table formatting, this will be a little bit trickier.

Table formatting conditions require the same number of columns to exist in each possible condition.

As far as how to use the current implementation... you can pipe multiple objects with a -ViewCondition in, provided as least one has no view condition.

I'm seeing that now after creating a multi TableRowEntry . I'll have to do what get-process -includeusername does and create another type unfortunately like MyType.Type#ComputerName in pstypenames or the like.

mattcargile avatar Jul 01 '24 17:07 mattcargile