<!-- 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

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

portNumber


</td><td>

number


</td><td>

Port number. Must be a positive integer.


</td></tr>
</tbody></table>

**Returns:**

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

## Remarks

RAM cost: 0 GB

Get a handle to a Netscript Port. Ports are shared across all hosts and contents are reset on game restart.

