Ports, Protocols, and Services

I know how to grab services off of remote machines because most tutorials wear get-service out. I am having trouble finding anything in PowerShell v3 to help with the ports part of the equation. Are there any cmdlets that allow you to scan a computer’s ports?

Not aware of anything in version 3. Version 4 added Test-NetConnection which sort of adds that functionality but I suspect you’d have to work a bit of magic like Boe Prox did with ping to make it useful.

While non-native PowerShell solutions do exist, I’d be inclined to use nmap for the port scanning and parse its XML output with PowerShell.