Skip to content

Instantly share code, notes, and snippets.

@sweetim
sweetim / get_wifi_password.ps1
Created January 28, 2023 01:53
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