Skip to content

Instantly share code, notes, and snippets.

@CybersamuraiDK
Forked from willjobs/wifi-passwords.ps1
Created October 3, 2020 17:18
Show Gist options
  • Save CybersamuraiDK/6e0be5c0c47165228895079efa8d98ec to your computer and use it in GitHub Desktop.
Save CybersamuraiDK/6e0be5c0c47165228895079efa8d98ec to your computer and use it in GitHub Desktop.
PowerShell script to show all wifi passwords saved in Windows
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize
@machavanne
Copy link

For windows in French :
Replace the English string : “Key Content\W+:(.+)$”
by the string : “Contenu de la clé\W+:(.+)$”

@BenSkecher
Copy link

BenSkecher commented Aug 30, 2024

Hey. Thanks for the code.
I was working on a project that requires me to create a small gui.
My powershell is rusty.
My main question is: how to access the individual elements of the output.
That is, the Profile_Names and Passwords individually, for the gui?
It would also be nice to use variables.
Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment