Hi all,
I’m re-using some Powershell scripts for my Badusb on the flipper. Problem is that many of these have advanced statements in them. Since i’m not good at writing code, I could use some help please!
How to convert this block to a one-liner:
$wlanKeys = netsh wlan show networks |ForEach-Object {
if ($_ -match '^SSID \d+\s*:\s*(.*)$') {
$ssidName = $Matches[1]
netsh wlan show profile "name=`"${ssidName}`"" key=clear |ForEach-Object {
if ($_ -match 'Key Content\s*:\s*(.*)$') {
[pscustomobject]@{
Name = $ssidName
Key = $Matches[1]
}
}
}
}
}