I am trying to get all known WiFi SSIDs including the Password.
When I use the following command called from a batch file, I can't get it to work. I get the following error:
Can someone please help me?
powershell -command "(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} >> %computername%.txt"
In Zeile:1 Zeichen:54
+ ... ng \:(.+)$ | {(netsh wlan show profile name=$name key=clear)} >> MEHL ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ausdrücke sind nur als erstes Element einer Pipeline zulässig.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpressionsMustBeFirstInPipeline