-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGetWiFi.ps1
48 lines (43 loc) · 1.07 KB
/
GetWiFi.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
44
45
46
47
48
netsh wlan show interfaces
netsh wlan show drivers
netsh wlan show network mode=bssid
$logs=@()
$date=Get-Date
$cmd=netsh wlan show networks mode=bssid
$n=$cmd.Count
For($i=0;$i -lt $n;$i++)
{
If($cmd[$i] -Match '^SSID[^:]+:.(.*)$')
{
$ssid=$Matches[1]
$i++
$bool=$cmd[$i] -Match 'Тип[^:]+:.(.+)$'
$Type=$Matches[1]
$i++
$bool=$cmd[$i] -Match 'Проверка[^:]+:.(.+)$'
$authent=$Matches[1]
$i++
$bool=$cmd[$i] -Match 'Шифрование[^:]+:.(.+)$'
$chiffrement=$Matches[1]
#Write-Output $cmd[$i];
$i++
While($cmd[$i] -Match 'BSSID[^:]+:.(.+)$')
{
$bssid=$Matches[1]
$i++
$bool=$cmd[$i] -Match 'Сигнал[^:]+:.(.+)$'
$signal=$Matches[1]
#Write-Output $cmd[$i];
$i++
$bool=$cmd[$i] -Match 'Тип[^:]+:.(.+)$'
$radio=$Matches[1]
$i++
$bool=$cmd[$i] -Match 'Канал[^:]+:.(.+)$'
$Channel=$Matches[1]
$i=$i+2
$logs+=[PSCustomObject]@{date=$date;ssid=$ssid;Authentication=$authent;Cipher=$chiffrement;bssid=$bssid;signal=$signal;radio=$radio;Channel=$Channel}
}
}
}
$cmd=$null
$logs|Out-GridView -Title 'Scan Wifi Script'