Just use a simple loop using a list of ports and the Test-Connection cmdlet.
Simple example:
'25','80','389','443','445','589'| %{Test-NetConnection -ComputerName $env:COMPUTERNAME -Port $_}
# Get parameters, examples, full and Online help for a cmdlet or function
# Get a list of all functions
Get-Command -CommandType Function
# Get a list of all commandlets
Get-Command -CommandType Cmdlet
# Get a list of all functions for the specified name
Get-Command -Name '*ADGroup*' -CommandType Function
# Get a list of all commandlets for the specified name
Get-Command -Name '*ADGroup**' -CommandType Cmdlet
# get function / cmdlet details
(Get-Command -Name Test-Connection).Parameters
Get-help -Name Test-Connection -Examples
Get-help -Name Test-Connection -Full
Get-help -Name Test-Connection -Online
Get-Help about_*
Get-Help about_Functions
# Find all cmdlets / functions with a target parameter
Get-Help * -Parameter Append
Get-Command -CommandType cmdlet `
| Where-Object { $_.parameters.keys -match 'credential'} `
| Format-Wide name -AutoSize
# All Help topics locations
explorer "$pshome\$($Host.CurrentCulture.Name)"