need refactorization Networking with powershell

This commit is contained in:
2026-01-10 00:29:55 +01:00
parent 357644d8a6
commit 6946de008c
2 changed files with 116 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
$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 ! "}
}