I came across this post http://www.expta.com/2009/08/name-that-port.html that gives the well known service for a TCP\UDP port. Useful script but its written in VBScript. Needs to be in PowerShell.
Easy. Create a script called get-port. It takes an integer as a port number. The ports and services are held in a here string and then ConvertFrom-StringData is used to create a hash table.
We then look up the port to get the service. Next trick is to turn it round so that we can find the port number given the string. I’ll add that next post and put the whole string on my skydrive as its too long to publish here