Skip to content

Instantly share code, notes, and snippets.

@Trucido
Last active March 4, 2019 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trucido/348a3bb6adc0e6977ab246502c46a89f to your computer and use it in GitHub Desktop.
Save Trucido/348a3bb6adc0e6977ab246502c46a89f to your computer and use it in GitHub Desktop.
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