Skip to content

Instantly share code, notes, and snippets.

@kac-
Forked from rleopold/wifi-forget.ps1
Created September 27, 2018 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kac-/c2640009bb451b6bdbf1464453b97707 to your computer and use it in GitHub Desktop.
Save kac-/c2640009bb451b6bdbf1464453b97707 to your computer and use it in GitHub Desktop.
a quick powershell script to make forgetting wifi networks easier
$networks = netsh wlan show profiles | select-string 'All User Profile'
if($networks.Count -gt 0) {
$(foreach ($item in $networks) {
$item.Line.Split(':')[1].Trim()
}) | Out-GridView -Title 'Select one or more neowrks to forget' -OutputMode Multiple |
foreach {
netsh wlan delete profile name = "$_"
}
}
else {'No wifi networks detected'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment