private static Type GetArgumentType(object argument) { if (argument == null) { return(typeof(LanguagePrimitives.Null)); } return(argument is PSReference psReference?Adapter.GetArgumentType(psReference.Value) : argument.GetType()); }
internal static ConversionRank GetArgumentConversionRank( object argument, Type parameterType) { ConversionRank conversionRank = LanguagePrimitives.GetConversionRank(Adapter.GetArgumentType(argument), parameterType); if (conversionRank == ConversionRank.None) { conversionRank = LanguagePrimitives.GetConversionRank(Adapter.GetArgumentType(PSObject.Base(argument)), parameterType); } return(conversionRank); }