Skip to content

Commit 965f416

Browse files
author
James Brundage
committed
feat: Get-WebSocket Fixing WebSocketClient job name default ( Fixes #76 )
Changing prefix to ws/wss
1 parent a03570b commit 965f416

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Commands/Get-WebSocket.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,10 +1205,14 @@ function Get-WebSocket {
12051205
. $SocketClientJob -Variable $Variable
12061206
return
12071207
}
1208+
1209+
# If -Debug was not passed, we're running in a background thread job.
12081210
$webSocketJob =
12091211
if ($SocketUrl) {
1212+
# If we had no name, we will use the SocketUrl as the name.
12101213
if (-not $name) {
1211-
$Name = $SocketUrl
1214+
# and we will ensure that it starts with `ws://` or `wss://`
1215+
$Name = $SocketUrl -replace '^http', 'ws'
12121216
}
12131217

12141218
$existingJob = foreach ($jobWithThisName in (Get-Job -Name $Name -ErrorAction Ignore)) {

0 commit comments

Comments
 (0)