Added haste module with New-Haste cmdlet
This commit is contained in:
parent
877f9adb4e
commit
92bd7ba69f
|
@ -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
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"package": {
|
||||
"Condition": [],
|
||||
"Name": "hastebin"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue