Test-Connection error

Welcome Forums General PowerShell Q&A Test-Connection error

This topic contains 2 replies, has 2 voices, and was last updated by

11 months ago.

  • Author
  • #102950

    Topics: 73
    Replies: 165
    Points: 65
    Rank: Member

    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 '' failed: Error due to lack of resources

    This is my syntax:

    Test-Connection -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.



  • #102953

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Not precise, but some useful workarounds: 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.

  • #102955

    Topics: 73
    Replies: 165
    Points: 65
    Rank: Member

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

The topic ‘Test-Connection error’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort