File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ function Get-WebSocket {
193
193
[switch ]
194
194
$Binary ,
195
195
196
+ # If set, will force a new job to be created, rather than reusing an existing job.
197
+ [switch ]
198
+ $Force ,
199
+
196
200
# The subprotocol used by the websocket. If not provided, this will default to `json`.
197
201
[string ]
198
202
$SubProtocol ,
@@ -437,6 +441,8 @@ function Get-WebSocket {
437
441
$ExecutionContext.SessionState.PSVariable.Set ($keyValue.Key , $keyValue.Value )
438
442
}
439
443
444
+ $Variable.JobRunspace = [Runspace ]::DefaultRunspace
445
+
440
446
# If we have routes, we will cache all of their possible parameters now
441
447
if ($route.Count ) {
442
448
# We want to keep the parameter sets
@@ -782,7 +788,7 @@ function Get-WebSocket {
782
788
}
783
789
}
784
790
785
- if ($existingJob ) {
791
+ if ($existingJob -and -not $Force ) {
786
792
$existingJob
787
793
} else {
788
794
Start-ThreadJob - ScriptBlock $SocketClientJob - Name $Name - InitializationScript $InitializationScript - ArgumentList $Variable
You can’t perform that action at this time.
0 commit comments