Skip to content

Instantly share code, notes, and snippets.

@steviecoaster
Created August 19, 2019 21:14
Show Gist options
  • Save steviecoaster/0aa95ba792a8067c7db329b9b398fb20 to your computer and use it in GitHub Desktop.
Save steviecoaster/0aa95ba792a8067c7db329b9b398fb20 to your computer and use it in GitHub Desktop.

Revisions

  1. steviecoaster created this gist Aug 19, 2019.
    12 changes: 12 additions & 0 deletions Get-DadJoke.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function Get-DadJoke {
    [cmdletBinding()]
    Param()

    process {
    $header = @{
    Accept = "application/json"
    }
    $joke = Invoke-RestMethod -Uri "https://icanhazdadjoke.com/" -Method Get -Headers $header
    $joke.joke
    }
    }