It iterates through just about every line in the output of the next command: netstat -aon @RodionSychev The powershell command is expecting you to switch "portNumber" While using the port number you are looking for. The error states that "portNumber" isn't a quantity. You most likely don't desire to kill https://helpmehigh.com/