Created
April 11, 2024 00:24
-
-
Save trackd/e43f98f09749df4f44814fe9001545d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-NerdFontGlyphs { | |
<# | |
.SYNOPSIS | |
Get a list of all Nerd Font Glyphs | |
.EXAMPLE | |
Get-NerdFontIcons | |
.EXAMPLE | |
Get-NerdFontIcons -AsHashtable | |
.PARAMETER AsHashtable | |
Return the list as a hashtable | |
#> | |
param( | |
[Switch] $AsHashtable | |
) | |
$glyphs = (Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json').psobject.properties | | |
Select-Object -Skip 1 | | |
ForEach-Object { | |
[PSCustomObject]@{ | |
Name = 'nf-' + $_.Name | |
Glyph = $_.Value.char | |
Hex = $_.Value.code | |
Int = [int]"0x$($_.value.code)" | |
} | |
} | |
if ($AsHashtable) { | |
return $glyphs | Group-Object -Property Name -AsHashTable | |
} | |
$glyphs | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment