Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<#
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; }
}
}
#>
function ToFileIO {
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
}
}
<#
function pb {
[ -t 0 ] && {
[ -n "$1" ] && {
curl -sLF c=@"$1" https://ptpb.pw/?u=1; return
}
}
curl -sLF c=@- https://ptpb.pw/?u=1
}
#>
function PB {
if (!$PSCmdlet.MyInvocation.ExpectingInput -and !$MyInvocation.ExpectingInput) {
if ($args) {
return $(curl -sF c=@"$args" https://ptpb.pw/?u=1)
}
}
$input | curl -sF c=@- https://ptpb.pw/?u=1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment