我對腳本不太熟悉,目前我正在嘗試一個腳本來檢查你連接的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打開它仍然是標記是安全的,雖然它應該標記爲不安全 –