question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a quiet parameter to Test-WSMan in order to returns a Boolean value

See original GitHub issue

Summary of the new feature/enhancement

Just like Test-Connection , add a quiet parameter to Test-WSMan in order to returns a Boolean value In some computer, WSMan is not enable by default. And sometimes I need to collect a list of computer with WSMan enabled via an if statement as bellow:

$ship | foreach -Parallel {if (Test-Connection -ComputerName $_ -Quiet -Count 2 -Delay 1) {$_}} -ThrottleLimit 10 | tee -Path .\2online.txt

Proposed technical implementation details (optional)

$ship | foreach -Parallel {if (Test-WSMan -ComputerName $_ -Quiet) {$_}} -ThrottleLimit 10 | tee -Path .\2online.txt

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
jdhitsolutionscommented, Mar 2, 2022

The Working Group has reviewed this and agrees there is a need for a -Quiet parameter to return a boolean value. While there is some debate about whether Quiet is the appropriate parameter name, there is precedent with Test-Connection and Select-String. This issue will be marked as Up for Grabs.

1reaction
jdhitsolutionscommented, Jun 14, 2021

Absolutely agree we need a -Quiet parameter to stay in line with other test commands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Friday Fun: A Better Test-WsMan
I added a parameter called -Quiet so that the command behaves like Test-Connection.
Read more >
Test-WSMan - PowerShell
This command tests to see whether the WS-Management (WinRM) service is running on the local computer by using the authentication parameter. Using the ......
Read more >
Powershell if true or false. I use this script to import the csv f
Thus, you will usually want to add the - Prompt parameter: Update on placement ... Returns a Boolean value (true or false), instead...
Read more >
How does PowerShell Ping Works with Examples?
-Quiet parameter suppress the output that the Test-Connection command generates and returns the output in the Boolean form.
Read more >
Test-Connection Return Value - powershell
So Test-Connection with the -quiet switch can return a boolean. Now I need to somehow test to see whether that is True or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found