Created
September 14, 2023 10:42
-
-
Save lewisgibson/a28ef9abaf8e125dd31e1227f477273e to your computer and use it in GitHub Desktop.
πΆ Retrieve and Display Wi-Fi Profile Passwords π
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script retrieves Wi-Fi profiles and their associated passwords. | |
.NOTES | |
Author: Lewis Gibson | |
#> | |
$wifiProfiles = (netsh wlan show profiles) | Select-String "^\s+:\s(.+)$" | ForEach-Object { | |
$name = $_.Matches.Groups[1].Value.Trim() | |
$profileInfo = netsh wlan show profile name="$name" key=clear | |
$pass = ($profileInfo | Select-String "Key Content\s+:\s(.+)$").Matches.Groups[1].Value.Trim() | |
[PSCustomObject]@{ PROFILE_NAME = $name; PASSWORD = $pass } | |
} | |
$wifiProfiles | Format-Table -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment