@@ -254,7 +254,7 @@ private static string InsertDimensionSize(string value, int dimensionSize)
254
254
return result ;
255
255
}
256
256
257
- private static VariableDetails [ ] GetChildren ( object obj )
257
+ private VariableDetails [ ] GetChildren ( object obj )
258
258
{
259
259
List < VariableDetails > childVariables = new List < VariableDetails > ( ) ;
260
260
@@ -281,6 +281,13 @@ private static VariableDetails[] GetChildren(object obj)
281
281
// If a PSObject other than a PSCustomObject, unwrap it.
282
282
if ( psObject != null )
283
283
{
284
+ // First add the PSObject's ETS propeties
285
+ childVariables . AddRange (
286
+ psObject
287
+ . Properties
288
+ . Where ( p => p . MemberType == PSMemberTypes . NoteProperty )
289
+ . Select ( p => new VariableDetails ( p ) ) ) ;
290
+
284
291
obj = psObject . BaseObject ;
285
292
}
286
293
@@ -329,13 +336,14 @@ private static VariableDetails[] GetChildren(object obj)
329
336
AddDotNetProperties ( obj , childVariables ) ;
330
337
}
331
338
}
332
- catch ( GetValueInvocationException )
339
+ catch ( GetValueInvocationException ex )
333
340
{
334
341
// This exception occurs when accessing the value of a
335
342
// variable causes a script to be executed. Right now
336
343
// we aren't loading children on the pipeline thread so
337
344
// this causes an exception to be raised. In this case,
338
345
// just return an empty list of children.
346
+ Logger . Write ( LogLevel . Warning , $ "Failed to get properties of variable { this . Name } , script execution was attempted: { ex . Message } ") ;
339
347
}
340
348
341
349
return childVariables . ToArray ( ) ;
0 commit comments