-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Resolve issue #2478 by adding -TimeOut to Test-Connection #2479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,14 @@ public class TestConnectionCommand : PSCmdlet | |
| [ValidateRange((int)0, (int)65500)] | ||
| public Int32 BufferSize { get; set; } = 32; | ||
|
|
||
| /// <summary> | ||
| /// The following is the definition of the input parameter "BufferSize". | ||
| /// Buffer size sent with the this command. The default value is 32. | ||
| /// </summary> | ||
| [Parameter] | ||
| [ValidateRange((int)1, Int32.MaxValue)] | ||
| public Int32 TimeOut { get; set; } = 1000; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm a little worried about this - how did you land on this value? Could the default value be Int32.MaxValue to maintain current behavior? Anyone using this new parameter would likely provide a much smaller number in any case
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MAXValue is clearly too large but that is what the API takes and I'm not sure what a reasonable MAX size would be so I juse use the MAXVALUE |
||
|
|
||
| /// <summary> | ||
| /// The following is the definition of the input parameter "ComputerName". | ||
| /// Value of the address requested. The form of the value can be either the | ||
|
|
@@ -399,6 +407,9 @@ private string QueryString(string[] machinenames, bool escaperequired, bool sele | |
| FilterString.Append(" And "); | ||
| FilterString.Append("BufferSize="); | ||
| FilterString.Append(BufferSize); | ||
| FilterString.Append(" And "); | ||
| FilterString.Append("TimeOut="); | ||
| FilterString.Append(TimeOut); | ||
| FilterString.Append(")"); | ||
| return FilterString.ToString(); | ||
| } | ||
|
|
@@ -612,6 +623,7 @@ private void ProcessWSManProtocolForTestConnection() | |
|
|
||
| using (CimSession cimSession = RemoteDiscoveryHelper.CreateCimSession(sourceComp, this.Credential, WsmanAuthentication, cancel.Token, this)) | ||
| { | ||
| WriteVerbose(String.Format("WMI query {0} sent to {1}", querystring, sourceComp)); | ||
| for (int echoRequestCount = 0; echoRequestCount < Count; echoRequestCount++) | ||
| { | ||
| IEnumerable<CimInstance> mCollection = cimSession.QueryInstances( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment must be updated. It was copied and pasted without modification.