File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,12 @@ function Get-WebSocket {
173
173
[TimeSpan ]
174
174
$TimeOut ,
175
175
176
+ # If provided, will decorate the objects outputted from a websocket job.
177
+ # This will only decorate objects converted from JSON.
178
+ [Alias (' PSTypeNames' , ' Decorate' , ' Decoration' )]
179
+ [string []]
180
+ $PSTypeName ,
181
+
176
182
# The maximum number of messages to receive before closing the WebSocket.
177
183
[long ]
178
184
$Maximum ,
@@ -256,6 +262,13 @@ function Get-WebSocket {
256
262
if ([string ]::IsNullOrWhitespace($JS )) { continue }
257
263
ConvertFrom-Json $JS
258
264
}
265
+ if ($PSTypeName ) {
266
+ $webSocketMessage.pstypenames.clear ()
267
+ [Array ]::Reverse($PSTypeName )
268
+ foreach ($psType in $psTypeName ) {
269
+ $webSocketMessage.pstypenames.add ($psType )
270
+ }
271
+ }
259
272
if ($handler ) {
260
273
$psCmd =
261
274
if ($runspace.LanguageMode -eq ' NoLanguage' -or
You can’t perform that action at this time.
0 commit comments