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 {
173173 [TimeSpan ]
174174 $TimeOut ,
175175
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+
176182 # The maximum number of messages to receive before closing the WebSocket.
177183 [long ]
178184 $Maximum ,
@@ -256,6 +262,13 @@ function Get-WebSocket {
256262 if ([string ]::IsNullOrWhitespace($JS )) { continue }
257263 ConvertFrom-Json $JS
258264 }
265+ if ($PSTypeName ) {
266+ $webSocketMessage.pstypenames.clear ()
267+ [Array ]::Reverse($PSTypeName )
268+ foreach ($psType in $psTypeName ) {
269+ $webSocketMessage.pstypenames.add ($psType )
270+ }
271+ }
259272 if ($handler ) {
260273 $psCmd =
261274 if ($runspace.LanguageMode -eq ' NoLanguage' -or
You can’t perform that action at this time.
0 commit comments