# Windows TCP/IP 查詢網路狀態 [TOC] ## PowerShell ### 取代 ping 的 Test-Connection ``` $ Test-Connection www.google.com ``` ### 取代 telnet 的 Test-NetConnection ``` $ Test-NetConnection www.google.com -Port 443 $ Test-NetConnection xxx.xxx.xxx.xxx -p xxxx ``` ### 取代 curl 的 Invoke-WebRequest ``` $ Invoke-WebRequest https://www.google.com ``` 參考資料: [Microsoft Ignite - Test-NetConnection](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.3&viewFallbackFrom=powershell-6) [[POWERSHELL][筆記] 在WINDOWS使用POWERSHELL的指令來取代PING, TELNET, CURL](https://hamisme.blogspot.com/2019/12/powershell-windowspowershellping-telnet.html) ## 強制停止佔用埠號的程序 查詢8080當前占用的pid ```=cmd $ netstat -ano | findstr :8080 ``` 刪除 ```=cmd $ taskkill /F /PID 0 ```