diff --git a/hastebin/New-Haste.ps1 b/hastebin/New-Haste.ps1 new file mode 100644 index 0000000..1aa3d74 --- /dev/null +++ b/hastebin/New-Haste.ps1 @@ -0,0 +1,24 @@ +[CmdletBinding()]param( + [Parameter(ValueFromPipeline,Mandatory,Position=1)] + $InputObject +) +begin { + $data = @() +} + +process { + $data += $InputObject +} + +end { + if( -not $HastebinBase ) { $HastebinBase = "https://h.lksz.me" } + $URI = "$HastebinBase/documents" + $Body = ($dataArray | Out-String).TrimEnd() + + $Response = Invoke-RestMethod -Method Post -Body $Body -Uri $URI + $key = $Response.key + + $hasteAddress = "$HastebinBase/$key" + + return $hasteAddress +} diff --git a/hastebin/_.package.json b/hastebin/_.package.json new file mode 100644 index 0000000..69f7cf4 --- /dev/null +++ b/hastebin/_.package.json @@ -0,0 +1,6 @@ +{ + "package": { + "Condition": [], + "Name": "hastebin" + } +}