如何检测某些SSID是否可用?
我有以下命令,该命令将列出可用的SSID。如果检测到特定的一个,我想拥有一个执行的小脚本。
PS C:\Users\User> $Networks = (netsh wlan show networks mode=Bssid | ?{$_ -like "SSID*"})
>>
SSID 1 : Home
SSID 2 : Guest
SSID 3 : i-Phone
例子:
$result = For($i = 0;$i -lt $Networks.count)
{
# parse through networks here?
}
$SSID = "i-Phone"
if ( $Networks.contains($SSID))
{
return $TRUE
}
else
{
return $FALSE
}
I have the following command that will list the available SSIDs. I'd like to have a small script that execute if a specific one of them is detected.
PS C:\Users\User> $Networks = (netsh wlan show networks mode=Bssid | ?{$_ -like "SSID*"})
>>
SSID 1 : Home
SSID 2 : Guest
SSID 3 : i-Phone
Example:
$result = For($i = 0;$i -lt $Networks.count)
{
# parse through networks here?
}
$SSID = "i-Phone"
if ( $Networks.contains($SSID))
{
return $TRUE
}
else
{
return $FALSE
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用下面建议的评论之一,并刚好分割和修剪该字符串,该字符串已根据需要工作:
Using one of the suggested comments below and just splitting and trimming the string this has worked as needed: