Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import subprocess
data = (
subprocess.check_output(["netsh", "wlan", "show", "profiles"])
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
for i in profiles:
results = (
.check_output(["netsh", "wlan", "show", "profile", i, "key=clear"])
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
print("{:<30}| {:<}".format(i, results[0]))
except IndexError:
print("{:<30}| {:<}".format(i, ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment