Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

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.

/// </summary>
[Parameter]
[ValidateRange((int)1, Int32.MaxValue)]
public Int32 TimeOut { get; set; } = 1000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1000 [](start = 45, length = 4)

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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(
Expand Down