-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
AnonUpload.psm1
39 lines (28 loc) · 1.09 KB
/
AnonUpload.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<#PSScriptInfo
.VERSION 1.4
.GUID cabe1358-d9ac-43fc-9b8e-4917152718a1
.AUTHOR simeononsecurity.ch
.COMPANYNAME SimeonOnSecurity
.COPYRIGHT (c) 2020 SimeonOnSecurity.. All rights reserved.
.TAGS AnonFiles Upload File Share FileShare
.PROJECTURI https://github.com/simeononsecurity/AnonUpload
.DESCRIPTION "Upload to AnonFiles.com easily Ex. 'AnonUpload -File 'C:\temp\test.txt'"
.RELEASENOTES
Init
#>
function AnonUpload {
#Requires -Version 6.0
param(
[string]$File
)
If (!$File) {
Write-Host "Please provide the a file. Ex: AnonUpload -File 'C:\temp\test.txt'"
}
Else {
Write-Output "Please wait wile the file is uploaded"
(Invoke-WebRequest -Method "Post" -Uri "https://api.anonfiles.com/upload" -Form @{file = (Get-Item $File) }).content -Split { $_ -eq '"' -or $_ -eq "{" -or $_ -eq "}" -or $_ -eq ',' -or $_ -eq ' ' } | Select-String -NoEmphasis -Pattern 'https' | Out-String | Set-Variable -Name links
Write-Output "`n"
Write-Output "Share your files with either of the following links:"
Write-Output "$links"
}
}