Assuming you have appropriate access, and there is a MSFT_NetTCPConnection object with the property 'AppliedSetting' that is equal to 'Internet', something like this should do the trick:
$cimSession = New-CimSession -ComputerName <ComputerName>
Get-NetTCPConnection -AppliedSetting Internet -CimSession $cimSession
Best Regards,
Nathan Giannini
If the Answer is helpful, please click "Accept Answer" and upvote it.