Sitelet https://web.archive.org/web/20201203172949/https://github.com/PowerShell/PowerShell/pull/14286
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Enable adding strongly typed format view defintion with Update-FormatData #14286

Open
wants to merge 6 commits into
base: master
from

Conversation

@Jawz84
Copy link
Contributor

@Jawz84 Jawz84 commented Nov 29, 2020 •

PR Summary

Closes #7845

The Update-TypeData command offers flexibility to load type data at runtime not only through loading files, but also through providing strongly typed type data. This Pull Request aims to bring that same kind of functionality to Update-FormatData.

  • Add a parameterset for adding strongly typed format view definitions to the current session. (-TypeName and -FormatViewDefinition parameters)
  • Add a test for this.
  • Add a parameterset for dynamically adding format view definitions (-TypeName, -ListProperties, - TableProperties, -WideProperty and -DefaultView [Table | List | Wide])
  • Add a test for dynamic loading of format view definitions.
  • Look into deduplicating format data entries in db.
  • Add more tests.

PR Context

I wanted to format objects in PowerShell, but found out that can only be done reliably through providing a .ps1xml file.
There is no easier way. I wrote about that here: https://joskw.gitbook.io/blog/object_formatting
And I found this issue #7845, which describes the problem.

PR Checklist

@Jawz84
Copy link
Contributor Author

@Jawz84 Jawz84 commented Nov 29, 2020

@anmenaga Hi Andrew, can you help me get a review of the work so far, so I know if this is up to par? Thanks!

@Jawz84 Jawz84 marked this pull request as ready for review Nov 29, 2020
@anmenaga anmenaga added the CL-General label Dec 2, 2020
@anmenaga
Copy link
Contributor

@anmenaga anmenaga commented Dec 2, 2020

Overall this looks up to par to me. Couple of notes:

  1. "WIP" must be removed from PR title (and corresponding checkbox in PR Checklist checked) before anybody will start in-depth review of the code. This is just this repo's process. "WIP" means "code changes in PR are not complete / not ready for review" therefore it does not make sense for people to spend time reviewing "WIP" PRs.
  2. "Documentation needed" is checked; in addition please follow that link and file an issue (something like "Need to document new Update-FormatData parameters") in PowerShell-Docs repository that links back to this PR; and add the link to that doc issue in "Issue filed:"
  3. what is meant by "Look into deduplicating format data entries in db." ?

PS. Thank you for picking up this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.