<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getPortHandle](./bitburner.ns.getporthandle.md)

## NS.getPortHandle() method

Get all data on a port.

**Signature:**

```typescript
getPortHandle(portNumber: number): NetscriptPort;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  portNumber | number | Port number. Must be a positive integer. |

**Returns:**

[NetscriptPort](./bitburner.netscriptport.md)

## Remarks

RAM cost: 0 GB

Get a handle to a Netscript Port.

