[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getPortHandle](./bitburner.ns.getporthandle.md)
## NS.getPortHandle() method
Get all data on a port.
Signature:
```typescript
getPortHandle(port: number): any[];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| port | number | Port number. Must be an integer between 1 and 20. |
Returns:
any\[\]
Data in the specified port.
## Remarks
RAM cost: 0 GB
Get a handle to a Netscript Port.
WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.