Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 2.51 KB

README.md

File metadata and controls

64 lines (43 loc) · 2.51 KB

GitHub Release Date - Published_At GitHub Downloads - All Releases GitHub Sponsor ko-fi

IsPortActive

This script checks if a port is currently active or in use. It can check for active TCP and UDP connections on a specified port, by process name, or by process ID.

If the process name is svchost, the script will find the service and display name in addition to the process name.

Requirements

  • PowerShell 7+

Installing

You can either download the PS1 script from here, or install using...

Install-Script IsPortActive -Force

Answer Yes to any prompts. -Force is optional, but it will force the script to update if it is outdated.

This script is published on PowerShell Gallery.

Usage

IsPortActive [-Port <int>] [-ProcessName <string>] [-ProcessId <int>] [-Version] [-Help] [-CheckForUpdate]

Parameters

Only one of the following parameters can be used at a time.

Parameter Description
-Port Specifies the port number to check for active connections.
-ProcessName Specifies the name of the process to check for active connections.
-ProcessId Specifies the process ID to check for active connections.
-Version Displays the version of the script.
-Help Displays the help information for the script.
-CheckForUpdate Checks for updates of the script.

Examples

Description Command
Check if port 443 is active IsPortActive -Port 443
Check what ports are being used by process httpd IsPortActive -ProcessName "httpd"
Check what ports are being used by process ID 1234 IsPortActive -ProcessId 1234

Screenshots

Check Port

image

Check Process Name

image

Check Process ID

image