Last active
March 4, 2019 20:30
-
-
Save Trucido/348a3bb6adc0e6977ab246502c46a89f 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 ToFileIO { | |
<# | |
function tofileio { | |
[ -f "$1" ] && { | |
local filename="$1" Uri='https://file.io/'; | |
curl -sL -F file=@"$filename" -H accept: application/json "$Uri" | { jq -r .link 2>/dev/null || cat; } | |
} | |
} | |
#> | |
if (Test-Path $args[0] -type Leaf) { | |
$local:filename = $args[0]; $local:Uri = 'https://file.io/' | |
(curl.exe -sL -F file=@"$filename" -H accept: application/json "$Uri" | ConvertFrom-Json).link | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment