-
-
Save CybersamuraiDK/6e0be5c0c47165228895079efa8d98ec to your computer and use it in GitHub Desktop.
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); ($details=netsh wlan show profile name="$name" key=clear) -and ($pass=($details | Select-String "Key Content\W+\:(.+)$").Matches.Groups[1].Value.Trim() -or "N/A"); [PSCustomObject]@{PROFILE_NAME=$name;PASSWORD=$pass}} | Format-Table -AutoSize |
no work W11
it works on my W11
no work W11
Select-String "Schlüsselinhalt\W+\:(.+)$" ...
change for the German version “Key Content” into “Schlüsselinhalt” this script will also work
For windows in French :
Replace the English string : “Key Content\W+:(.+)$”
by the string : “Contenu de la clé\W+:(.+)$”
Hey. Thanks for the code.
I was working on a project that requires me to create a small gui.
My powershell is rusty.
My main question is: how to access the individual elements of the output.
That is, the Profile_Names and Passwords individually, for the gui?
It would also be nice to use variables.
Thanks in advance.
does not work there is an error
Select-StringKey Content\W+:(.+)$: The module 'Select-StringKey Content' could not be loaded. For more information, run 'Import-Module Select-StringKey Content'.
Try thats
PART 1 : Networking
Get All Stored Wifi-Passwords
1 . Get current basic network Information.
Get-NetIPConfiguration
if that doesnt work !
(netsh wlan show profiles) -match "All User Profile\s*: (.*)" | %{(netsh wlan show profile $_.trim() key=clear)} | Select-String "Key Content" | ForEach-Object {$_ -replace "Key Content\s*: ", ""}
To Display only Keys :
(netsh wlan show profile name=wifi-name key=clear) | Select-String "Key Content" | ForEach-Object { $_.ToString().Split(":")[1].Trim() }
Display only Wifi-Keys
IF IT DOES NOT WORK TRY THESE SIMPLE COMMAND ( Everyone Knows :)
netsh wlan show profile Name=* Key=clear
GET ALL PROFILE NAMES WITH PASSWORDS .
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table –AutoSize | Out-String -OutVariable dataCaptured
PART 1 : Networking
Get All Stored Wifi-Passwords
1 . Get current basic network Information.
Get-NetIPConfiguration
if that doesnt work !
(netsh wlan show profiles) -match "All User Profile\s*: (.*)" | %{(netsh wlan show profile $_.trim() key=clear)} | Select-String "Key Content" | ForEach-Object {$_ -replace "Key Content\s*: ", ""}
To Display only Keys :
(netsh wlan show profile name=wifi-name key=clear) | Select-String "Key Content" | ForEach-Object { $_.ToString().Split(":")[1].Trim() }
Display only Wifi-Keys
IF IT DOES NOT WORK TRY THESE SIMPLE COMMAND ( Everyone Knows :)
netsh wlan show profile Name=* Key=clear
GET ALL PROFILE NAMES WITH PASSWORDS .
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table –AutoSize | Out-String -OutVariable dataCaptured
Thanks for the one liner. Does wotk on W10.