PSGitHub icon indicating copy to clipboard operation
PSGitHub copied to clipboard

Add PowerShell formatting files

Open pcgeek86 opened this issue 8 years ago • 5 comments

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

pcgeek86 avatar Mar 20 '16 20:03 pcgeek86

100% agree with the "no XML"!! I would be interested in helping you with this Trevor.

sagreer avatar Mar 21 '16 18:03 sagreer

@sagreer Awesome, Steve! That would be really helpful! There are [at least] a couple of different approaches we could take here:

  1. We build out data models (using PowerShell v5 Classes) and then provide the formatting files for those object types.
  2. We use the object output directly from Invoke-RestMethod, but inside each PSGitHub command, we use the PSTypeNames 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

pcgeek86 avatar Mar 22 '16 04:03 pcgeek86

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 avatar Mar 22 '16 06:03 doesitscript

@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.

pcgeek86 avatar Mar 24 '16 06:03 pcgeek86

I would personally prefer if the object output stayed as close to the API output as possible (for example only changing the casing convention).

felixfbecker avatar Jun 09 '18 04:06 felixfbecker