pcgeek86 / PSGitHub

This PowerShell module contains commands to manage GitHub through its REST API.
MIT License
182 stars 39 forks source link

Add PowerShell formatting files #11

Open pcgeek86 opened 8 years ago

pcgeek86 commented 8 years ago

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

sagreer commented 8 years ago

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

pcgeek86 commented 8 years ago

@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

doesitscript commented 8 years ago

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.

pcgeek86 commented 8 years ago

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

felixfbecker commented 6 years ago

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