Skip to content

Instantly share code, notes, and snippets.

@nohwnd
Created February 13, 2019 18:52
Show Gist options
  • Save nohwnd/4f7713a3548a9bb376b47c0a0129d930 to your computer and use it in GitHub Desktop.
Save nohwnd/4f7713a3548a9bb376b47c0a0129d930 to your computer and use it in GitHub Desktop.
Ascii art from api
function Get-Banner {
param (
[Parameter(Mandatory)]
[String] $Text
)
if (-not $fonts) {
$fonts = (Invoke-RestMethod -Method GET -Uri 'http://artii.herokuapp.com/fonts_list') -split "`n"
}
$f = Get-Random -Minimum 0 -Maximum $fonts.Length
$font = $fonts[$f]
$escapedFont = [Uri]::EscapeUriString($font)
$escapedText = [Uri]::EscapeUriString($Text)
$banner = Invoke-RestMethod -Method GET -Uri "http://artii.herokuapp.com/make?text=$escapedText&font=$escapedFont"
Write-Host $banner -ForegroundColor Magenta
}
foreach ($none in 1.. 10) {
Get-Banner -Text "PSPowerHour"
Start-Sleep -Seconds 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment