Created
November 17, 2022 15:06
-
-
Save mattou07/a8f4ab8ed75bf27207929d8a7b2d8422 to your computer and use it in GitHub Desktop.
A small script to list your wifi profiles and retrieve the password if present
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$netshResult = &netsh wlan show profile | |
$wifiList = @() | |
foreach($t in $netshResult){ | |
$line = $t -split(":") | |
if($line[1]){ | |
$wifiList += $line[1].substring(1) | |
} | |
} | |
for($i=0; $i -le $wifiList.Length-1; $i++) | |
{Write-Host "$i "$wifiList[$i]} | |
$SSID = Read-Host -Prompt "Please pick the SSID you need" | |
$choice = $wifiList[$SSID] | |
&netsh wlan show profile name=$choice key=clear | |
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment