How to get all saved WIFI passwords in Windows (PowerShell)

Today I came across this nice gist: https://gist.github.com/gowon/3baa3f61a6f28232f7c3a331233e5c2f

Running this in PowerShell will show you all your saved WIFI passwords in Windows.

(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]@{ SSID=$name;SECURITY_KEY=$pass }} | Format-Table -AutoSize