我对脚本不太熟悉,目前我正在尝试一个脚本来检查你连接的ssid。
如果它是安全的,它会显示你是安全的,如果你连接到一个开放的WiFi它会告诉你,你是不安全的。Powershell如果声明不起作用
文件下面
function Test-WiFiSecured{
$props = netsh wlan show interfaces |
Select-Object -skip 4 |
Where{$_.Trim()} |
ForEach-Object{ $_ -replace ':', '=' } |
Out-String |
ConvertFrom-StringData
$wifi = [pscustomobject]$props
Write-Host 'Authentication='$wifi.Authentication -ForeGround Green
if($wifi.Profile -eq 'Open'){
Write-Host 'Not secure' -ForeGround Red
} else {
Write-Host 'Secure connection' -ForeGround Green
return $true
}
}
Test-WiFiSecured
因为即时通讯的任何援助欣赏完全没了主意,现在
感谢
你在这里有什么错误?什么不工作? – vrdse
WhenAuthentication打开它仍然是标记是安全的,虽然它应该标记为不安全 –