Skip to content

Default Export-FormatData to pretty-printing or add an option #6681

Description

Related: #6680

One use case for Export-FormatData - even though about_Format.ps1xml doesn't currently mention it - is to use existing formatting definitions as a starting point for creating new ones.

To that end, outputting pretty-printed XML would be much more convenient - currently, a single-line XML string is output.

  • If changing the existing behavior is not a backward-compatibility concern:

    • Simply output pretty-printed XML by default (it will consume more space, however)
  • Otherwise:

    • Introduce a switch such as -Format (or, to follow the - inverted - logic of ConvertTo-Json, perhaps -Uncompress?) that results in pretty-printed output.

Environment data

Written as of:

PowerShell Core v6.0.2

Activity

  1. BrucePay commented on Apr 20, 2018

    @BrucePay
    Collaborator

    Michael Klement (@mklement0) This sounds like a good thing to do. (I would have thought we were already doing it actually.) Anyway, as long as the result is valid XML, simply pretty-printing it should fall within acceptable changes.

  2. SteveL-MSFT commented on Apr 20, 2018

    @SteveL-MSFT
    Member

    Pretty printed xml is well-formed and valid, so there's no functional impact. Seems like a good idea and should be a small change.

  3. added
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Apr 20, 2018
  4. added and removed
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions