Skip to content

Instantly share code, notes, and snippets.

@eizedev
Created January 5, 2024 15:54
Show Gist options
  • Save eizedev/dd518e435a1bfb03ecf7e40727568272 to your computer and use it in GitHub Desktop.
Save eizedev/dd518e435a1bfb03ecf7e40727568272 to your computer and use it in GitHub Desktop.
quick'n'dirty powershell "script" to get wifi credentials of known and stored wifi profiles.German version: `Get-WifiPassword-DE.ps1`, English version `Get-WifiPassword-EN.ps1`
$WifiCred = @()
$listProfiles = netsh wlan show profiles | Select-String -Pattern "Profil für alle Benutzer" | ForEach-Object { ($_ -split ":")[-1].Trim() };
$listProfiles | ForEach-Object {
$profileInfo = netsh wlan show profiles name=$_ key="clear";
$Key = $profileInfo | Select-String -Pattern "Schlüsselinhalt" | ForEach-Object { ($_ -split ":")[-1].Trim() };
$WifiCred += New-Object -TypeName psobject -Property @{SSID = $_; Password = $Key }
}
Write-Output $WifiCred
$WifiCred = @()
$listProfiles = netsh wlan show profiles | Select-String -Pattern "All User Profile" | ForEach-Object { ($_ -split ":")[-1].Trim() };
$listProfiles | ForEach-Object {
$profileInfo = netsh wlan show profiles name=$_ key="clear";
$Key = $profileInfo | Select-String -Pattern "Key Content" | ForEach-Object { ($_ -split ":")[-1].Trim() };
$WifiCred += New-Object -TypeName psobject -Property @{SSID = $_; Password = $Key }
}
Write-Output $WifiCred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment