Tripl3Six
Tripl3Six
Tripl3Six @ Snip2Code
1 Snippet  (378th place)
Published
1 Channel
Created
0 Channels
Following
Nov 26, 2017
Last Visit
Nov 24, 2017
Registered
3 points  (13417th place)
Reputation
Junior Autobiographer
Senior Autobiographer

Recent Snippets See all snippets by Tripl3Six

public by andrewhart098 created Nov 24, 2017  86  1  2  0

Powershell script that list all previously known wifi networks and their associated passwords

Powershell script that list all previously known wifi networks and their associated passwords: wifi-remember.ps1
# The number of lines skipped in the following command may need to be altered if "Group policy profiles" are available
$profiles = $(netsh wlan show profiles)  -split "\n" | Select-Object -Skip 9 | Select -SkipLast 1

foreach($profile in $profiles)
{
    $network = $profile.Split(":")[1].Replace(" ", "")
    $info = $(netsh wlan show profile $network key=clear)
    $key = $info | Select-String -Pattern "Key Content"
    $cleanKey = If (!$key.Line) {"No Password Required"} Else {$key.Line.Split(":")[1].Replace(" ", "")}
    Write-Output ("{0}  -  {1}" -f $network,$cleanKey)
}

;