PSGitHub
PSGitHub copied to clipboard
Add PowerShell formatting files
We need to add formatting files for object output, to ensure that useful data is displayed by default. As a prerequisite to this, we will need to build out a GitHub data model (probably using PowerShell v5 Classes), and map the GitHub REST API output to the data models.
NOTE: This work item is exempt form the contribution guidelines, which state "no XML." :smile:
Priority Work Items
- [ ] Formatting file for GitHub Repositories
- [ ] Formatting file for GitHub Users
- [ ] Formatting file for GitHub Issues
- [ ] Formatting file for GitHub Gists
100% agree with the "no XML"!! I would be interested in helping you with this Trevor.
@sagreer Awesome, Steve! That would be really helpful! There are [at least] a couple of different approaches we could take here:
- We build out data models (using PowerShell v5 Classes) and then provide the formatting files for those object types.
- We use the object output directly from
Invoke-RestMethod
, but inside each PSGitHub command, we use thePSTypeNames
to assign a "type" to the object(s) before emitting them.
Can we set up a [regular] Skype (not Skype for Business) call to discuss this? My username is the same.
Cheers, Trevor Sullivan
What kind of formatting file are you thinking of? The two that come to mind are: YAML & MD. The drawback to YAML being that it has a DLL dependency. MD drawback would be that guidelines would have to set for how to use the MD (similar to platyPS which a few members of the PS team use for generating help for their advanced functions).
Just trying to gauge if I may be able to jump in, based on what you're thinking the best approach is to this task.
@doesitscript I'm actually referring to the standard PowerShell *.format.ps1xml
files that are used to format object output in the host. We need to build out a sort of object model, most likely using PowerShell v5 class definitions, for things like Repositories, Gists, Users, Issues, etc., and then update all of the existing functions to emit these objects, instead of the generic objects that are returned by Invoke-RestMethod
.
I would personally prefer if the object output stayed as close to the API output as possible (for example only changing the casing convention).