Skip to content

Instantly share code, notes, and snippets.

@sweetim
Created January 28, 2023 01:53
Show Gist options
  • Save sweetim/e70351e99040432b1238e5e44361d6a7 to your computer and use it in GitHub Desktop.
Save sweetim/e70351e99040432b1238e5e44361d6a7 to your computer and use it in GitHub Desktop.
get known wifi password in windows 11
(netsh wlan show profiles) `
| Select-String "\:(.+)$" `
| %{$network=$_.Matches.Groups[1].Value.Trim(); $_} `
| %{(netsh wlan show profile name="$network" key=clear)} `
| Select-String "Key Content\W+\:(.+)$" `
| %{$password=$_.Matches.Groups[1].Value.Trim(); $_} `
| %{[PSCustomObject]@{ NETWORK_NAME=$network;PASSWORD=$password }} `
| Format-Table -AutoSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment