need refactorization Networking with powershell
This commit is contained in:
9
4.Networking/1.check_port.ps1
Normal file
9
4.Networking/1.check_port.ps1
Normal 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 ! "}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user