Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save m4l1c3/b5d413d254c558624f0503a7b47e1fd1 to your computer and use it in GitHub Desktop.
Save m4l1c3/b5d413d254c558624f0503a7b47e1fd1 to your computer and use it in GitHub Desktop.
I found this on pastebin, not the author putting here in case it disappears. Original: https://pastebin.com/MuUdJaG7
(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 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment