You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.
In PowerShell v5, Test-Connection -Quiet will return True or False, in PowerShell Core 6.2.2, it still returns the entire ping result. In scripts I have that pipe the result to Out-Null, it works fine in v5, but 6.2.2 still outputs data.
I also have an in progress draft PR #10044 that will resolve this specific issue as well as add some additional improvements. I plan to finish it before PS7 release, but I have not had a lot of time to work on it recently. I'll see if I can get the kinks ironed out by this weekend, and then start getting the necessary PRs in, one at a time. 🙂
Also, the additional output in 6.2.2 is actually not output. It's data sent to the Information stream with a PSHOST tag to force it to display (much like how Write-Host works). It will only display in the console, not actually affecting the output of your script if you capture it into variables or pipe to Out-Null.
You can suppress the information stream data in a few ways, but you'll need to work with the redirection operator to do so. One way might be:
That makes sense. I only posted after testing it out when one of the functions in a custom module for work was returning the result from Test-Connection that is piped to Out-Null in the script. It does not output any results in PS v5.1, but in PS 6.2 it does. I'll rewrite one of the functions and add something similar to your example above and test it out. This should suffice until your work is complete.
I don't know if I would close this as resolved because the root issue is still not resolved, being that -Quiet still does absolutely nothing and I don't get a $True/$False return easily. How about we fix this before closing it, or I don't know, re-introduce the original code from 2 years ago that already had this fixed without needing this stupid workaround.
You will in ps7. I have a PR that addresses this which I think is already merged, and there are further PRs in review that will further improve the output from Test-Connection.
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.
Activity
vexx32 commentedon Aug 16, 2019
This is a duplicate of #6768
I also have an in progress draft PR #10044 that will resolve this specific issue as well as add some additional improvements. I plan to finish it before PS7 release, but I have not had a lot of time to work on it recently. I'll see if I can get the kinks ironed out by this weekend, and then start getting the necessary PRs in, one at a time. 🙂
Also, the additional output in 6.2.2 is actually not output. It's data sent to the Information stream with a PSHOST tag to force it to display (much like how
Write-Hostworks). It will only display in the console, not actually affecting the output of your script if you capture it into variables or pipe to Out-Null.You can suppress the information stream data in a few ways, but you'll need to work with the redirection operator to do so. One way might be:
clsmith70 commentedon Aug 16, 2019
That makes sense. I only posted after testing it out when one of the functions in a custom module for work was returning the result from Test-Connection that is piped to Out-Null in the script. It does not output any results in PS v5.1, but in PS 6.2 it does. I'll rewrite one of the functions and add something similar to your example above and test it out. This should suffice until your work is complete.
Thanks Rain Sallow (/u/ta11ow) (@vexx32)!
tibmeister commentedon Sep 25, 2019
I don't know if I would close this as resolved because the root issue is still not resolved, being that -Quiet still does absolutely nothing and I don't get a $True/$False return easily. How about we fix this before closing it, or I don't know, re-introduce the original code from 2 years ago that already had this fixed without needing this stupid workaround.
vexx32 commentedon Sep 25, 2019
You will in ps7. I have a PR that addresses this which I think is already merged, and there are further PRs in review that will further improve the output from Test-Connection.