It iterates by means of each individual line from your output of the subsequent command: netstat -aon @RodionSychev The powershell command is anticipating you to exchange "portNumber" With all the port quantity you are seeking. The error states that "portNumber" isn't a selection. Is there any approach or top secret https://helpmehigh.com/