MicrosoftDocs / PowerShell-Docs

The official PowerShell documentation sources
https://learn.microsoft.com/powershell
Other
1.96k stars 1.56k forks source link

Document OutOfBand for formatData #4145

Closed TravisEz13 closed 3 years ago

TravisEz13 commented 5 years ago

Issue Details

It supports list and custom controls

It tells the formatter that the object should be formatted using this objects format, even if a format has already been chosen for the output

in ps1xml

            <View>
            <Name>WarningRecord</Name>
            <OutOfBand/>
            <ViewSelectedBy>
                <TypeName>System.Management.Automation.WarningRecord</TypeName>
            </ViewSelectedBy>
            <CustomControl>
                <CustomEntries>
                    <CustomEntry>
                        <CustomItem>
                            <ExpressionBinding>
                                <PropertyName>Message</PropertyName>
                            </ExpressionBinding>
                        </CustomItem>
                    </CustomEntry>
                </CustomEntries>
            </CustomControl>
        </View>

Version(s) of document impacted

Reason(s) for not selecting all version of documents

sdwheeler commented 5 years ago

@TravisEz13 Which document would this go in? Is this new to v6.2? Can you give examples for how to use this?

TravisEz13 commented 5 years ago

It would be in one of these documents: https://github.com/MicrosoftDocs/PowerShell-Docs/blob/db9992a9db45f53db0c1a969b28b3f1ccddb8924/developer/format/formatting-file-concepts.md

I don't see a perfect match.

I included an example of how to use it in the issue.

This was added at least in PowerShell 4.0 (I checked the boxes)

sdwheeler commented 5 years ago

What about about_Format.ps1xml.md?

TravisEz13 commented 5 years ago

FYI, I'm working with a partner on this and produced more complete examples here: https://github.com/TravisEz13/PSFormattingExamples

TravisEz13 commented 5 years ago

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md and all the others seems right.