Script results differ depending on 1st ping

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 15 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
santonsen
Posts: 33
Last visit: Thu Dec 13, 2012 12:27 am

Script results differ depending on 1st ping

Post by santonsen »

I run this script format for many scripts. I ping each computer from a text file list, then do a if / else statement for the computer. If the 1st computer pings successfully, the entire script runs perfectly. If the 1st computer is not successfully pinged, the results still come back showing the ping results per machine. Problem is that it doesn
User avatar
santonsen
Posts: 33
Last visit: Thu Dec 13, 2012 12:27 am

Script results differ depending on 1st ping

Post by santonsen »

I run this script format for many scripts. I ping each computer from a text file list, then do a if / else statement for the computer. If the 1st computer pings successfully, the entire script runs perfectly. If the 1st computer is not successfully pinged, the results still come back showing the ping results per machine. Problem is that it doesn
User avatar
santonsen
Posts: 33
Last visit: Thu Dec 13, 2012 12:27 am

Script results differ depending on 1st ping

Post by santonsen »

I copied your 'if' line direcly, but the results remain the same. Any other thoughts?

Thanks for the reply.
User avatar
santonsen
Posts: 33
Last visit: Thu Dec 13, 2012 12:27 am

Script results differ depending on 1st ping

Post by santonsen »

Uhm... I think you missed the problem. I always get the correct ping results. The problem is when the first computer in the list is a 'no-ping', the full list
User avatar
santonsen
Posts: 33
Last visit: Thu Dec 13, 2012 12:27 am

Script results differ depending on 1st ping

Post by santonsen »

Yes
User avatar
santonsen
Posts: 33
Last visit: Thu Dec 13, 2012 12:27 am

Script results differ depending on 1st ping

Post by santonsen »

I get it - your 'object structures have changed' makes sense to me. I'll give it a re-work per your instructions. Thank you for your time and patience! You've been very helpful :)
This topic is 15 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked