/// <summary> /// Decode exception. /// </summary> private static Exception DecodeException(PSObject psObject) { object result = RemoteHostEncoder.DecodePropertyValue(psObject, RemoteDataNameStrings.MethodException, typeof(Exception)); if (result == null) { return(null); } if (result is Exception) { return((Exception)result); } throw RemoteHostExceptions.NewDecodingFailedException(); }
private static Exception DecodeException(PSObject psObject) { object obj2 = RemoteHostEncoder.DecodePropertyValue(psObject, "me", typeof(Exception)); if (obj2 == null) { return(null); } if (!(obj2 is Exception)) { throw RemoteHostExceptions.NewDecodingFailedException(); } return((Exception)obj2); }
/// <summary> /// Decode return value. /// </summary> private static object DecodeReturnValue(PSObject psObject, Type returnType) { object returnValue = RemoteHostEncoder.DecodePropertyValue(psObject, RemoteDataNameStrings.MethodReturnValue, returnType); return(returnValue); }
private static object DecodeReturnValue(PSObject psObject, Type returnType) { return(RemoteHostEncoder.DecodePropertyValue(psObject, "mr", returnType)); }