feat(api docs): added in bruno api docs

This commit is contained in:
2025-09-05 09:15:32 -05:00
parent 6d5f444471
commit 37bc473f58
6 changed files with 90 additions and 0 deletions

42
scripts/ipPortChecker.ps1 Normal file
View File

@@ -0,0 +1,42 @@
param(
[Parameter(Mandatory = $true)]
[string]$TargetHost,
[Parameter(Mandatory = $false)]
[int]$Port
)
function Test-Ping {
param([string]$ComputerName)
if (Test-Connection -ComputerName $ComputerName -Count 1 -Quiet) {
Write-Host "[$ComputerName] is reachable via ICMP (ping)."
}
else {
Write-Host "[$ComputerName] did not respond to ICMP (ping)."
}
}
function Test-Port {
param([string]$ComputerName, [int]$Port)
$result = Test-NetConnection -ComputerName $ComputerName -Port $Port -InformationLevel Quiet
if ($result) {
Write-Host "[$ComputerName]:$Port is reachable (TCP connect succeeded)."
}
else {
Write-Host "[$ComputerName]:$Port is not reachable."
}
}
# --- Main execution ---
Test-Ping -ComputerName $TargetHost
if ($Port) {
Test-Port -ComputerName $TargetHost -Port $Port
}
# Example calls:
# Test-Ping -Host "8.8.8.8"
# Test-Port -Host "google.com" -Port 443
Test-NetConnection -ComputerName 192.168.75.125 -Port 5118