title: PowerShell v5.1 test network port
body: <p>I want to check to see if a port is open using PowerShell v5.1 on Windows 7.</p>
  
  <p>On my Windows&nbsp;10 laptop with PowerShell v5.1 I can use</p>
  
  <pre><code>Test-NetConnection -ComputerName &lt;IP&gt; -Port &lt;Port&gt;
  </code></pre>
  
  <p>However, on my Windows 7 laptop the <a href="https://docs.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection" rel="nofollow noreferrer"><code>Test-NetConnection</code></a> cmdlet is not found. I have <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-connection" rel="nofollow noreferrer"><code>Test-Connection</code></a> available, but that cmdlet doesn't allow me to specify a port.</p>
  
  <p>Is there a way on Windows 7 with PowerShell 5.1 to test if a network port is open? How can I get the <code>Test-NetConnection</code> cmdlet back?</p>