@@ -213,7 +213,7 @@ function Get-WebSocket {
213
213
[Alias (' Headers' )]
214
214
$Header ,
215
215
216
- # The name of the WebSocket job.
216
+ # The name of the WebSocket job.
217
217
[string ]
218
218
$Name ,
219
219
@@ -222,6 +222,7 @@ function Get-WebSocket {
222
222
$InitializationScript = {},
223
223
224
224
# The buffer size. Defaults to 16kb.
225
+ [Parameter (ValueFromPipelineByPropertyName )]
225
226
[int ]
226
227
$BufferSize = 64 kb ,
227
228
@@ -346,10 +347,12 @@ function Get-WebSocket {
346
347
$PSTypeName ,
347
348
348
349
# The maximum number of messages to receive before closing the WebSocket.
350
+ [Parameter (ValueFromPipelineByPropertyName )]
349
351
[long ]
350
352
$Maximum ,
351
353
352
354
# The throttle limit used when creating background jobs.
355
+ [Parameter (ValueFromPipelineByPropertyName )]
353
356
[int ]
354
357
$ThrottleLimit = 64 ,
355
358
@@ -1138,7 +1141,21 @@ function Get-WebSocket {
1138
1141
}
1139
1142
}
1140
1143
1141
- process {
1144
+ process {
1145
+ # Sometimes we want to customize the behavior of a command based off of the input object
1146
+ # So, start off by capturing $_
1147
+ $inputObject = $_
1148
+ # If the input was a job, we might remap a parameter
1149
+ if ($inputObject -is [ThreadJob.ThreadJob ]) {
1150
+ if ($inputObject.WebSocket -is [Net.WebSockets.ClientWebSocket ] -and
1151
+ $inputObject.SocketUrl ) {
1152
+ $SocketUrl = $inputObject.SocketUrl
1153
+ }
1154
+ if ($inputObject.HttpListener -is [Net.HttpListener ] -and
1155
+ $inputObject.RootUrl ) {
1156
+ $RootUrl = $inputObject.RootUrl
1157
+ }
1158
+ }
1142
1159
if ((-not $SocketUrl ) -and (-not $RootUrl )) {
1143
1160
$socketAndListenerJobs =
1144
1161
foreach ($job in Get-Job ) {
0 commit comments