tshm
8/7/2017 - 11:41 AM

wifi signal retriever

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