Skip to content

Instantly share code, notes, and snippets.

@jdhitsolutions
Last active April 7, 2024 11:39
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdhitsolutions/36f16e9b2d89353cfa93edc8e4b5b3c3 to your computer and use it in GitHub Desktop.
Save jdhitsolutions/36f16e9b2d89353cfa93edc8e4b5b3c3 to your computer and use it in GitHub Desktop.
PowerShell Podcast Scripting Challenge

PowerShell Podcast ScriptingChallenge

This is the PowerShell scripting challenge from my appearance on the PowerShell Podcast

Base Challenge

Using whatever tools and techniques you want, write a PowerShell function that will query the Issues section of a GitHub repository and create output showing the number of open issues by label and the percentage of all open issues. Remember that multiple labels may be used with an issue.

For example, if there are 54 open issues and the bug label is used 23 times,your output would show a count of 23 and a total percentage of 42.59 for the bug label.

The function should work for any GitHub repository, but test it with the PowerShell repository. Naturally, the function should follow community accepted best practices, have parameter validation, and proper error handling.

Bonus Challenges

Once you have the function, add custom formatting to display the results in a table, including the repository name or path.

Create an alternative view that will also display the repository and the label URI that GitHub uses to create a filtered page view.

Finally, create a control script using the function to create a markdown report for the PowerShell repository showing the top 25 labels. The markdown report should have clickable links.

You will most likely end up with several files to meet all the challenge requirements.

Hint: There's more than one way to access the GitHub API.

To Participate

We hope many people will test their skills with this challenge. You are encouraged to post a comment with a link to your solution. Please do not post your solution. In about 4-6 weeks, I will post my solutions. There is no single correct solution to this challenge and the goal is to have fun and learn something new along the way.

Happy Scripting!

@pauljnav
Copy link

pauljnav commented Apr 7, 2024

Hi @jdhitsolutions / all,
Heres my solution.
Im late to this challenge but would appreciate feedback especially as I took the GitHub API approach (unauthenticated and rate-limited)
Paul

LabelCountPercent
Needs-Triage51855.52%
Issue-Enhancement30833.01%
WG-Engine12112.97%
Review - Needed11412.22%
Issue-Bug849.00%
Up-for-Grabs717.61%
WG-Cmdlets697.40%
WG-Cmdlets-Utility606.43%
Extra Small586.22%
In-PR576.11%
WG-NeedsReview515.47%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment