forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewPSSessionOptionCommand.cs
More file actions
643 lines (579 loc) · 26.9 KB
/
Copy pathNewPSSessionOptionCommand.cs
File metadata and controls
643 lines (579 loc) · 26.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Management.Automation;
using System.Management.Automation.Remoting;
using System.Management.Automation.Runspaces;
namespace System.Management.Automation.Remoting
{
/// <summary>
/// IMPORTANT: proxy configuration is supported for HTTPS only; for HTTP, the direct
/// connection to the server is used
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
public enum ProxyAccessType
{
/// <summary>
/// ProxyAccessType is not specified. That means Proxy information (ProxyAccessType, ProxyAuthenticationMechanism
/// and ProxyCredential)is not passed to WSMan at all.
/// </summary>
None = 0,
/// <summary>
/// use the Internet Explorer proxy configuration for the current user.
/// Internet Explorer proxy settings for the current active network connection.
/// This option requires the user profile to be loaded, so the option can
/// be directly used when called within a process that is running under
/// an interactive user account identity; if the client application is running
/// under a user context different than the interactive user, the client
/// application has to explicitly load the user profile prior to using this option.
/// </summary>
IEConfig = 1,
/// <summary>
/// proxy settings configured for WinHTTP, using the ProxyCfg.exe utility
/// </summary>
WinHttpConfig = 2,
/// <summary>
/// Force autodetection of proxy
/// </summary>
AutoDetect = 4,
/// <summary>
/// do not use a proxy server - resolves all host names locally
/// </summary>
NoProxyServer = 8
}
/// <summary>
/// Options for a remote PSSession
/// </summary>
public sealed class PSSessionOption
{
/// <summary>
/// Creates a new instance of <see cref="PSSessionOption"/>
/// </summary>
public PSSessionOption()
{
}
/// <summary>
/// The MaximumConnectionRedirectionCount parameter enables the implicit redirection functionality.
/// -1 = no limit
/// 0 = no redirection
/// </summary>
public int MaximumConnectionRedirectionCount { get; set; } = WSManConnectionInfo.defaultMaximumConnectionRedirectionCount;
/// <summary>
/// If false, underlying WSMan infrastructure will compress data sent on the network.
/// If true, data will not be compressed. Compression improves performance by
/// reducing the amount of data sent on the network. Compression my require extra
/// memory consumption and CPU usage. In cases where available memory / CPU is less,
/// set this property to "true".
/// By default the value of this property is "false".
/// </summary>
public bool NoCompression { get; set; } = false;
/// <summary>
/// If <c>true</c> then Operating System won't load the user profile (i.e. registry keys under HKCU) on the remote server
/// which can result in a faster session creation time. This option won't have any effect if the remote machine has
/// already loaded the profile (i.e. in another session).
/// </summary>
public bool NoMachineProfile { get; set; } = false;
/// <summary>
/// By default, ProxyAccessType is None, that means Proxy information (ProxyAccessType,
/// ProxyAuthenticationMechanism and ProxyCredential)is not passed to WSMan at all.
/// </summary>
public ProxyAccessType ProxyAccessType { get; set; } = ProxyAccessType.None;
/// <summary>
/// The following is the definition of the input parameter "ProxyAuthentication".
/// This parameter takes a set of authentication methods the user can select
/// from. The available options should be as follows:
/// - Negotiate: Use the default authentication (as defined by the underlying
/// protocol) for establishing a remote connection.
/// - Basic: Use basic authentication for establishing a remote connection
/// - Digest: Use Digest authentication for establishing a remote connection
///
/// Default is Negotiate.
/// </summary>
public AuthenticationMechanism ProxyAuthentication
{
get { return _proxyAuthentication; }
set
{
switch (value)
{
case AuthenticationMechanism.Basic:
case AuthenticationMechanism.Negotiate:
case AuthenticationMechanism.Digest:
_proxyAuthentication = value;
break;
default:
string message = PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.ProxyAmbiguosAuthentication,
value,
AuthenticationMechanism.Basic.ToString(),
AuthenticationMechanism.Negotiate.ToString(),
AuthenticationMechanism.Digest.ToString());
throw new ArgumentException(message);
}
}
}
private AuthenticationMechanism _proxyAuthentication = AuthenticationMechanism.Negotiate;
/// <summary>
/// The following is the definition of the input parameter "ProxyCredential".
/// </summary>
public PSCredential ProxyCredential { get; set; }
/// <summary>
/// When connecting over HTTPS, the client does not validate that the server
/// certificate is signed by a trusted certificate authority (CA). Use only when
/// the remote computer is trusted by other means, for example, if the remote
/// computer is part of a network that is physically secure and isolated or the
/// remote computer is listed as a trusted host in WinRM configuration
/// </summary>
public bool SkipCACheck { get; set; }
/// <summary>
/// Indicates that certificate common name (CN) of the server need not match the
/// hostname of the server. Used only in remote operations using https. This
/// option should only be used for trusted machines.
/// </summary>
public bool SkipCNCheck { get; set; }
/// <summary>
/// Indicates that certificate common name (CN) of the server need not match the
/// hostname of the server. Used only in remote operations using https. This
/// option should only be used for trusted machines
/// </summary>
public bool SkipRevocationCheck { get; set; }
/// <summary>
/// The duration for which PowerShell remoting waits before timing out
/// for any operation. The user would like to tweak this timeout
/// depending on whether he/she is connecting to a machine in the data
/// center or across a slow WAN.
///
/// Default: 3*60*1000 == 3minutes
/// </summary>
public TimeSpan OperationTimeout { get; set; } = TimeSpan.FromMilliseconds(BaseTransportManager.ClientDefaultOperationTimeoutMs);
/// <summary>
/// Specifies that no encryption will be used when doing remote operations over
/// http. Unencrypted traffix is not allowed by default and must be enabled in
/// the local configuration
/// </summary>
public bool NoEncryption { get; set; }
/// <summary>
/// Indicates the request is encoded in UTF16 format rather than UTF8 format;
/// UTF8 is the default.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "UTF")]
public bool UseUTF16 { get; set; }
/// <summary>
/// Uses Service Principal Name (SPN) along with the Port number during authentication.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SPN")]
public bool IncludePortInSPN { get; set; }
/// <summary>
/// Determines how server in disconnected state deals with cached output
/// data when the cache becomes filled.
/// Default value is 'block mode' where command execution is blocked after
/// the server side data cache becomes filled.
/// </summary>
public OutputBufferingMode OutputBufferingMode { get; set; } = WSManConnectionInfo.DefaultOutputBufferingMode;
/// <summary>
/// Number of times a connection will be re-attempted when a connection fails due to network
/// issues.
/// </summary>
public int MaxConnectionRetryCount { get; set; } = WSManConnectionInfo.DefaultMaxConnectionRetryCount;
/// <summary>
/// Culture that the remote session should use
/// </summary>
public CultureInfo Culture { get; set; }
/// <summary>
/// UI culture that the remote session should use
/// </summary>
public CultureInfo UICulture { get; set; }
/// <summary>
/// Total data (in bytes) that can be received from a remote machine
/// targeted towards a command. If null, then the size is unlimited.
/// Default is unlimited data.
/// </summary>
public Nullable<int> MaximumReceivedDataSizePerCommand { get; set; }
/// <summary>
/// Maximum size (in bytes) of a deserialized object received from a remote machine.
/// If null, then the size is unlimited. Default is 200MB object size.
/// </summary>
public Nullable<int> MaximumReceivedObjectSize { get; set; } = 200 << 20;
/// <summary>
/// Application arguments the server can see in <see cref="System.Management.Automation.Remoting.PSSenderInfo.ApplicationArguments"/>
/// </summary>
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public PSPrimitiveDictionary ApplicationArguments { get; set; }
/// <summary>
/// The duration for which PowerShell remoting waits before timing out on a connection to a remote machine.
/// Simply put, the timeout for a remote runspace creation.
/// The user would like to tweak this timeout depending on whether
/// he/she is connecting to a machine in the data center or across a slow WAN.
///
/// Default: 3 * 60 * 1000 = 3 minutes
/// </summary>
public TimeSpan OpenTimeout { get; set; } = TimeSpan.FromMilliseconds(RunspaceConnectionInfo.DefaultOpenTimeout);
/// <summary>
/// The duration for which PowerShell should wait before it times out on cancel operations
/// (close runspace or stop powershell). For instance, when the user hits ctrl-C,
/// New-PSSession cmdlet tries to call a stop on all remote runspaces which are in the Opening state.
/// The user wouldnt mind waiting for 15 seconds, but this should be time bound and of a shorter duration.
/// A high timeout here like 3 minutes will give the user a feeling that the PowerShell client has hung.
///
/// Default: 60 * 1000 = 1 minute
/// </summary>
public TimeSpan CancelTimeout { get; set; } = TimeSpan.FromMilliseconds(RunspaceConnectionInfo.defaultCancelTimeout);
/// <summary>
/// The duration for which a Runspace on server needs to wait before it declares the client dead and closes itself down.
/// This is especially important as these values may have to be configured differently for enterprise administration
/// and exchange scenarios.
///
/// Default: -1 -> Use current server value for IdleTimeout.
/// </summary>
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromMilliseconds(RunspaceConnectionInfo.DefaultIdleTimeout);
}
}
namespace Microsoft.PowerShell.Commands
{
/// <summary>
/// This class implements New-PSSessionOption cmdlet.
/// Spec: TBD
/// </summary>
[Cmdlet(VerbsCommon.New, "PSSessionOption", HelpUri = "http://go.microsoft.com/fwlink/?LinkID=144305", RemotingCapability = RemotingCapability.None)]
[OutputType(typeof(PSSessionOption))]
public sealed class NewPSSessionOptionCommand : PSCmdlet
{
#region Parameters (specific to PSSessionOption)
/// <summary>
/// The MaximumRedirection parameter enables the implicit redirection functionality
/// -1 = no limit
/// 0 = no redirection
/// </summary>
[Parameter]
public int MaximumRedirection
{
get { return _maximumRedirection.Value; }
set { _maximumRedirection = value; }
}
private int? _maximumRedirection;
/// <summary>
/// If false, underlying WSMan infrastructure will compress data sent on the network.
/// If true, data will not be compressed. Compression improves performance by
/// reducing the amount of data sent on the network. Compression my require extra
/// memory consumption and CPU usage. In cases where available memory / CPU is less,
/// set this property to "true".
/// By default the value of this property is "false".
/// </summary>
[Parameter]
public SwitchParameter NoCompression { get; set; }
/// <summary>
/// If <c>true</c> then Operating System won't load the user profile (i.e. registry keys under HKCU) on the remote server
/// which can result in a faster session creation time. This option won't have any effect if the remote machine has
/// already loaded the profile (i.e. in another session).
/// </summary>
[Parameter]
public SwitchParameter NoMachineProfile { get; set; }
/// <summary>
/// Culture that the remote session should use
/// </summary>
[Parameter]
[ValidateNotNull]
public CultureInfo Culture { get; set; }
/// <summary>
/// UI culture that the remote session should use
/// </summary>
[Parameter]
[ValidateNotNull]
public CultureInfo UICulture { get; set; }
/// <summary>
/// Total data (in bytes) that can be received from a remote machine
/// targeted towards a command. If null, then the size is unlimited.
/// Default is unlimited data.
/// </summary>
[Parameter]
public int MaximumReceivedDataSizePerCommand
{
get { return _maxRecvdDataSizePerCommand.Value; }
set { _maxRecvdDataSizePerCommand = value; }
}
private Nullable<int> _maxRecvdDataSizePerCommand;
/// <summary>
/// Maximum size (in bytes) of a deserialized object received from a remote machine.
/// If null, then the size is unlimited. Default is unlimited object size.
/// </summary>
[Parameter]
public int MaximumReceivedObjectSize
{
get { return _maxRecvdObjectSize.Value; }
set { _maxRecvdObjectSize = value; }
}
private Nullable<int> _maxRecvdObjectSize;
/// <summary>
/// Specifies the output mode on the server when it is in Disconnected mode
/// and its output data cache becomes full.
/// </summary>
[Parameter]
public OutputBufferingMode OutputBufferingMode { get; set; }
/// <summary>
/// Maximum number of times a connection will be re-attempted when a connection fails due to network
/// issues.
/// </summary>
[Parameter]
[ValidateRange(0, Int32.MaxValue)]
public int MaxConnectionRetryCount { get; set; }
/// <summary>
/// Application arguments the server can see in <see cref="System.Management.Automation.Remoting.PSSenderInfo.ApplicationArguments"/>
/// </summary>
[Parameter]
[ValidateNotNull]
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public PSPrimitiveDictionary ApplicationArguments { get; set; }
/// <summary>
/// The duration for which PowerShell remoting waits (in milliseconds) before timing
/// out on a connection to a remote machine. Simply put, the timeout for a remote
/// runspace creation.
///
/// The user would like to tweak this timeout depending on whether
/// he/she is connecting to a machine in the data center or across a slow WAN.
/// </summary>
[Parameter]
[Alias("OpenTimeoutMSec")]
[ValidateRange(0, Int32.MaxValue)]
public int OpenTimeout
{
get
{
return _openTimeout.HasValue ? _openTimeout.Value :
RunspaceConnectionInfo.DefaultOpenTimeout;
}
set { _openTimeout = value; }
}
private int? _openTimeout;
/// <summary>
/// The duration for which PowerShell should wait (in milliseconds) before it
/// times out on cancel operations (close runspace or stop powershell). For
/// instance, when the user hits ctrl-C, New-PSSession cmdlet tries to call a
/// stop on all remote runspaces which are in the Opening state. The user
/// wouldnt mind waiting for 15 seconds, but this should be time bound and of a
/// shorter duration. A high timeout here like 3 minutes will give the user
/// a feeling that the PowerShell client has hung.
/// </summary>
[Parameter]
[Alias("CancelTimeoutMSec")]
[ValidateRange(0, Int32.MaxValue)]
public int CancelTimeout
{
get
{
return _cancelTimeout.HasValue ? _cancelTimeout.Value :
BaseTransportManager.ClientCloseTimeoutMs;
}
set { _cancelTimeout = value; }
}
private int? _cancelTimeout;
/// <summary>
/// The duration for which a Runspace on server needs to wait (in milliseconds) before it
/// declares the client dead and closes itself down.
/// This is especially important as these values may have to be configured differently
/// for enterprise administration scenarios.
/// </summary>
[Parameter]
[ValidateRange(-1, Int32.MaxValue)]
[Alias("IdleTimeoutMSec")]
public int IdleTimeout
{
get
{
return _idleTimeout.HasValue ? _idleTimeout.Value
: RunspaceConnectionInfo.DefaultIdleTimeout;
}
set { _idleTimeout = value; }
}
private int? _idleTimeout;
#endregion Parameters
#region Parameters copied from New-WSManSessionOption
/// <summary>
/// By default, ProxyAccessType is None, that means Proxy information (ProxyAccessType,
/// ProxyAuthenticationMechanism and ProxyCredential)is not passed to WSMan at all.
/// </summary>
[Parameter]
[ValidateNotNullOrEmpty]
public ProxyAccessType ProxyAccessType { get; set; } = ProxyAccessType.None;
/// <summary>
/// The following is the definition of the input parameter "ProxyAuthentication".
/// This parameter takes a set of authentication methods the user can select
/// from. The available options should be as follows:
/// - Negotiate: Use the default authentication (as defined by the underlying
/// protocol) for establishing a remote connection.
/// - Basic: Use basic authentication for establishing a remote connection
/// - Digest: Use Digest authentication for establishing a remote connection
/// </summary>
[Parameter]
public AuthenticationMechanism ProxyAuthentication { get; set; } = AuthenticationMechanism.Negotiate;
/// <summary>
/// The following is the definition of the input parameter "ProxyCredential".
/// </summary>
[Parameter]
[ValidateNotNullOrEmpty]
[Credential]
public PSCredential ProxyCredential { get; set; }
/// <summary>
/// The following is the definition of the input parameter "SkipCACheck".
/// When connecting over HTTPS, the client does not validate that the server
/// certificate is signed by a trusted certificate authority (CA). Use only when
/// the remote computer is trusted by other means, for example, if the remote
/// computer is part of a network that is physically secure and isolated or the
/// remote computer is listed as a trusted host in WinRM configuration
/// </summary>
[Parameter]
public SwitchParameter SkipCACheck
{
get { return _skipcacheck; }
set { _skipcacheck = value; }
}
private bool _skipcacheck;
/// <summary>
/// The following is the definition of the input parameter "SkipCNCheck".
/// Indicates that certificate common name (CN) of the server need not match the
/// hostname of the server. Used only in remote operations using https. This
/// option should only be used for trusted machines
/// </summary>
[Parameter]
public SwitchParameter SkipCNCheck
{
get { return _skipcncheck; }
set { _skipcncheck = value; }
}
private bool _skipcncheck;
/// <summary>
/// The following is the definition of the input parameter "SkipRevocation".
/// Indicates that certificate common name (CN) of the server need not match the
/// hostname of the server. Used only in remote operations using https. This
/// option should only be used for trusted machines
/// </summary>
[Parameter]
public SwitchParameter SkipRevocationCheck
{
get { return _skiprevocationcheck; }
set { _skiprevocationcheck = value; }
}
private bool _skiprevocationcheck;
/// <summary>
/// The following is the definition of the input parameter "Timeout".
/// Defines the timeout in milliseconds for the wsman operation
/// </summary>
[Parameter]
[Alias("OperationTimeoutMSec")]
[ValidateRange(0, Int32.MaxValue)]
public Int32 OperationTimeout
{
get
{
return (_operationtimeout.HasValue ? _operationtimeout.Value :
BaseTransportManager.ClientDefaultOperationTimeoutMs);
}
set { _operationtimeout = value; }
}
private Int32? _operationtimeout;
/// <summary>
/// The following is the definition of the input parameter "UnEncrypted".
/// Specifies that no encryption will be used when doing remote operations over
/// http. Unencrypted traffix is not allowed by default and must be enabled in
/// the local configuration
/// </summary>
[Parameter]
public SwitchParameter NoEncryption
{
get { return _noencryption; }
set
{
_noencryption = value;
}
}
private bool _noencryption;
/// <summary>
/// The following is the definition of the input parameter "UTF16".
/// Indicates the request is encoded in UTF16 format rather than UTF8 format;
/// UTF8 is the default.
/// </summary>
[Parameter]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "UTF")]
public SwitchParameter UseUTF16
{
get { return _useutf16; }
set
{
_useutf16 = value;
}
}
private bool _useutf16;
/// <summary>
/// Uses Service Principal Name (SPN) along with the Port number during authentication.
/// </summary>
[Parameter]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SPN")]
public SwitchParameter IncludePortInSPN
{
get { return _includePortInSPN; }
set { _includePortInSPN = value; }
}
private bool _includePortInSPN;
#endregion
#region Implementation
/// <summary>
/// Performs initialization of cmdlet execution.
/// </summary>
protected override void BeginProcessing()
{
PSSessionOption result = new PSSessionOption();
// Begin: WSMan specific options
result.ProxyAccessType = this.ProxyAccessType;
result.ProxyAuthentication = this.ProxyAuthentication;
result.ProxyCredential = this.ProxyCredential;
result.SkipCACheck = this.SkipCACheck;
result.SkipCNCheck = this.SkipCNCheck;
result.SkipRevocationCheck = this.SkipRevocationCheck;
if (_operationtimeout.HasValue)
{
result.OperationTimeout = TimeSpan.FromMilliseconds(_operationtimeout.Value);
}
result.NoEncryption = this.NoEncryption;
result.UseUTF16 = this.UseUTF16;
result.IncludePortInSPN = this.IncludePortInSPN;
// End: WSMan specific options
if (_maximumRedirection.HasValue)
{
result.MaximumConnectionRedirectionCount = this.MaximumRedirection;
}
result.NoCompression = this.NoCompression.IsPresent;
result.NoMachineProfile = this.NoMachineProfile.IsPresent;
result.MaximumReceivedDataSizePerCommand = _maxRecvdDataSizePerCommand;
result.MaximumReceivedObjectSize = _maxRecvdObjectSize;
if (this.Culture != null)
{
result.Culture = this.Culture;
}
if (this.UICulture != null)
{
result.UICulture = this.UICulture;
}
if (_openTimeout.HasValue)
{
result.OpenTimeout = TimeSpan.FromMilliseconds(_openTimeout.Value);
}
if (_cancelTimeout.HasValue)
{
result.CancelTimeout = TimeSpan.FromMilliseconds(_cancelTimeout.Value);
}
if (_idleTimeout.HasValue)
{
result.IdleTimeout = TimeSpan.FromMilliseconds(_idleTimeout.Value);
}
result.OutputBufferingMode = OutputBufferingMode;
result.MaxConnectionRetryCount = MaxConnectionRetryCount;
if (this.ApplicationArguments != null)
{
result.ApplicationArguments = this.ApplicationArguments;
}
this.WriteObject(result);
}
#endregion Methods
}
}