Skip to content

Instantly share code, notes, and snippets.

@richard-scott
Forked from Saturate/GetAllWifiPasswords.ps1
Created October 4, 2019 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richard-scott/a69202213d225d518ae4197fa658bfb9 to your computer and use it in GitHub Desktop.
Save richard-scott/a69202213d225d518ae4197fa658bfb9 to your computer and use it in GitHub Desktop.
PowerShell Wifi Script
# Run this script as an Admin user and get a list of all WiFi passwords.
$listProfiles = netsh wlan show profiles | Select-String -Pattern "All User Profile" | %{ ($_ -split ":")[-1].Trim() };
$listProfiles | foreach {
$profileInfo = netsh wlan show profiles name=$_ key="clear";
$SSID = $profileInfo | Select-String -Pattern "SSID Name" | %{ ($_ -split ":")[-1].Trim() };
$Key = $profileInfo | Select-String -Pattern "Key Content" | %{ ($_ -split ":")[-1].Trim() };
[PSCustomObject]@{
WifiProfileName = $SSID;
Password = $Key
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment