In my previous post MarkdownPS I explained the basic cmdlets of the PowerShell module MarkdownPS.
Shields.io provides many interesting badges out of the box, but there is also an API that can be used to render any badge.
https://img.shields.io/badge/<SUBJECT>-<STATUS>-<COLOR>.svg
The above just renders
On version 1.4 of the MarkdownPS a new parameter set was added to the New-MDImage
cmdlet to drive this api.
New-MDImage -Subject "<SUBJECT>" -Status "<STATUS>" -Color red
Renders
![](https://img.shields.io/badge/%3CSUBJECT%3E-%3CSTATUS%3E-red.svg)
The produced url in the image is url encoded. The parameter -Color
accepts only values that the shields.io API allows.
Color | Badge |
---|---|
brightgreen | |
green | |
yellowgreen | |
brightgreen | |
yellow | |
orange | |
red | |
lightgrey | |
blue |
To make a badge clickable then use the -Link
parameter like this
New-MDImage -Subject "example.com" -Status "OK" -Color green -Link "https://example.com"
Leave a Comment