- <# :
- @echo off
- powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0' |Out-String|Invoke-Expression"
- pause
- #>
- $a='''network={
- ConfigKey="209"WPA_PSK
- SSID="209"
- PreSharedKey="00000000"
- WEPTxKeyIndex=0
- HiddenSSID=false
- AllowedKeyMgmt=02
- AllowedProtocols=03
- AllowedAuthAlgos=
- AllowedGroupCiphers=0f
- AllowedPairwiseCiphers=06
- CreatorUid=1000
- MacRandomizationSetting=3
- }
- network={
- ConfigKey="209"SAE
- SSID="209"
- PreSharedKey="00000000"
- WEPTxKeyIndex=0
- HiddenSSID=false
- AllowedKeyMgmt=0001
- AllowedProtocols=02
- AllowedAuthAlgos=
- AllowedGroupCiphers=a8
- AllowedPairwiseCiphers=2c
- CreatorUid=1000
- MacRandomizationSetting=3
- }
- network={
- ConfigKey="217"WPA_PSK
- SSID="217"
- PreSharedKey="00000000"
- WEPTxKeyIndex=0
- HiddenSSID=false
- AllowedKeyMgmt=02
- AllowedProtocols=03
- AllowedAuthAlgos=
- AllowedGroupCiphers=0f
- AllowedPairwiseCiphers=06
- CreatorUid=1000
- MacRandomizationSetting=3
- }
- network={
- ConfigKey="217"SAE
- SSID="217"
- PreSharedKey="00000000"
- WEPTxKeyIndex=0
- HiddenSSID=false
- AllowedKeyMgmt=0001
- AllowedProtocols=02
- AllowedAuthAlgos=
- AllowedGroupCiphers=a8
- AllowedPairwiseCiphers=2c
- CreatorUid=1000
- MacRandomizationSetting=3
- }
- '''
- $regex = [regex]'SSID=".*?"[\s\S]+?PreSharedKey=".*?"'
- $regex.Matches($a)|Select-Object -Unique|select Value|%{$_.Value}
复制代码
|