Advertisement
Wasif_Hasan_

WiFiPasswordViewer.ps1

Sep 10th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $profiles=(netsh wlan show profiles | Select-String "All User Profile\s+:\s+(.*)").Matches.Groups | Where-Object {$_.Value -notmatch "All User Profile*"} | Foreach {
  2.   $wlan=netsh wlan show profiles name=$_ key=clear
  3.   [pscustomobject][ordered]@{
  4.     'SSID' = ($wlan | Select-String "SSID Name\s+:\s+(.*)").Matches.Groups[1].Value
  5.     'Radio Type' = ($wlan | Select-String "Radio Type\s+:\s+(.*)").Matches.Groups[1].Value
  6.     'Authentication' = ($wlan | Select-String "Authentication\s+:\s+(.*)").Matches.Groups[1].Value
  7.     'Password' = ($wlan | Select-String "Key Content\s+:\s+(.*)").Matches.Groups[1].Value
  8.   }
  9. } | Out-GridView -Title "Saved Wi-Fi passwords (Hold CTRL and select Wi-Fi profiles to apply actions on them)" -Passthru
  10. "You have selected:`n$($profiles)"
  11. $msg=@"
  12. `n
  13. [1] Delete
  14. [2] Quit
  15. "@
  16. choice /c 12 /n /m $Msg
  17. switch($LastExitCode){
  18. 1{$profiles|foreach{netsh wlan delete profile name=$_.ssid}}
  19. 2{exit 0}
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement