GitHub.Emojis.psm1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# GitHub.Emojis

<#
.SYNOPSIS
Short description

.DESCRIPTION
Long description

.PARAMETER Token
Parameter description

.EXAMPLE
An example

.NOTES
https://docs.github.com/en/rest/reference/emojis#get-emojis
#>

function Get-GitHubEmojis {
    [CmdletBinding()]
    param (
        $Destination
    )

    $Response = Invoke-GitHubAPI -Method Get -APIEndpoint emojis

    if (Test-Path -Path $Destination) {
        $Response.PSobject.Properties | ForEach-Object -Parallel {
            Invoke-WebRequest -Uri $_.Value -OutFile "$using:Destination/$($_.Name).png"
        }
    }

    return $Response
}