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.
$data = @'
1 = TCP Port Service Multiplexer
2 = Management Utility
3 = Compression Process
4 = Unassigned
.... lots more in here
48003 = Nimbus Gateway
48556 = com-bardac-dw
$ports = ConvertFrom-StringData -StringData $data
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