# Test-Connection error

**URL:** <https://forums.powershell.org/t/test-connection-error/10852>\
**Category:** PowerShell Help\
**Created:** [June 21, 2018, 12:50pm UTC](https://forums.powershell.org/t/test-connection-error/10852 "2018-06-21T12:50:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tony-antony](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tony-antony/32/192_2.png) [@tony-antony](https://forums.powershell.org/u/tony-antony)\
**Post date:** [June 21, 2018, 12:50pm UTC](https://forums.powershell.org/t/test-connection-error/10852/1 "2018-06-21T12:50:36Z")

</div>

I’m building a network status html page. Everything works the I want it to work so far.

But, I noticed that sometimes, I get this error  
Test-Connection : Testing connection to computer ‘8.8.8.80’ failed: Error due to lack of resources

This is my syntax:

```
Test-Connection 8.8.8.80 -Count 1 -Quiet
```
  
I know this is not a real IP address, so it should be coming as “False”, but I’m getting the message.

Thanks,

Tony

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [June 21, 2018, 1:06pm UTC](https://forums.powershell.org/t/test-connection-error/10852/2 "2018-06-21T13:06:05Z")

</div>

Not precise, but some useful workarounds: [ping - Powershell - Test-Connection failed due to lack of resources - Stack Overflow](https://stackoverflow.com/questions/41267553/powershell-test-connection-failed-due-to-lack-of-resources)

It might also be useful to bypass the Test-Connection wrapper and just use the Win32\_PingStatus class directly. You’d query that from your local computer and have it try to ping whatever address, and then interpret the status codes yourself.

---

<div class="post-metadata">

**Author:** ![tony-antony](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tony-antony/32/192_2.png) [@tony-antony](https://forums.powershell.org/u/tony-antony)\
**Post date:** [June 21, 2018, 1:22pm UTC](https://forums.powershell.org/t/test-connection-error/10852/3 "2018-06-21T13:22:21Z")

</div>

Thank you Don. I’ll give that a try.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/test-connection-error/10852/4 "2024-05-16T20:34:55Z")

</div>


