Created
August 7, 2017 11:41
-
-
Save tshm/e07415902a2381b798306fe354b45363 to your computer and use it in GitHub Desktop.
wifi signal retriever
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$strDump = netsh wlan show interfaces | |
$objInterface = "" | Select-Object SSID,BSSID,Signal | |
foreach ($strLine in $strDump) { | |
if ($strLine -match "^\s+SSID") { | |
$objInterface.SSID = $strLine -Replace "^\s+SSID\s+:\s+","" | |
} elseif ($strLine -match "^\s+BSSID") { | |
$objInterface.BSSID = $strLine -Replace "^\s+BSSID\s+:\s+","" | |
} elseif ($strLine -match "^\s+Signal") { | |
$objInterface.Signal = $strLine -Replace "^\s+Signal\s+:\s+","" | |
} | |
} | |
# Do whatever with the resulting object. We'll just print it out here | |
$objInterface |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment