Created
July 23, 2021 13:55
-
-
Save Tiberriver256/23387fb1e28f8d0e065ab59565404de5 to your computer and use it in GitHub Desktop.
Get me some dad jokes
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
<# | |
.SYNOPSIS | |
Get some filler text that is dad jokes | |
.PARAMETER minLength | |
The minimum length of text you need | |
PS> Get-DadJokeIpsum -minLength 500 | |
Where did Captain Hook get his hook? From a second hand store. Why was the broom late for the meeting? He overswept. Dad, can you put my shoes on? I don't think they'll fit me. For Valentine's day, I decided to get my wife some beads for an abacus. It's the little things that count. Why is the ocean always blue? Because the shore never waves back. How does a dyslexic poet write? Inverse. Whiteboards ... are remarkable. Want to hear a joke about construction? Nah, I'm still working on it. Why do scuba divers fall backwards into the water? Because if they fell forwards theyâd still be in the boat. Some people say that comedians who tell one too many light bulb jokes soon burn out, but they don't know watt they are talking about. They're not that bright. Don't trust atoms. They make up everything. I am terrified of elevators. Iâm going to start taking steps to avoid them. Did you hear the joke about the wandering nun? She was a roman catholic. What do you call two barracuda fish? A Pairacuda! | |
#> | |
function Get-DadJokeIpsum([int]$minLength) { | |
$string = "" | |
do { | |
$string += (Invoke-RestMethod -Uri "https://icanhazdadjoke.com" -Headers @{Accept = "text/plain"}) + " " | |
} while ($string.length -lt $minLength) | |
return $string | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment