10 lines
212 B
PowerShell
10 lines
212 B
PowerShell
$ports = 22,80
|
|
$ports | forEach-Object {
|
|
$port = $PSItem;
|
|
if(Test-NetConnection udemy.com -Port $port){
|
|
Write-Host "Hey, $port is open !"}
|
|
else {
|
|
Write-Host "Hey, $port is closed ! "}
|
|
}
|
|
|