Skip to content

Instantly share code, notes, and snippets.

@tshm
Created August 7, 2017 11:41
Show Gist options
  • Save tshm/e07415902a2381b798306fe354b45363 to your computer and use it in GitHub Desktop.
Save tshm/e07415902a2381b798306fe354b45363 to your computer and use it in GitHub Desktop.
wifi signal retriever
$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