private static object GenerateMemberSet(string name, object obj) { PSObject psObject = PSObject.AsPSObject(obj); PSMemberInfo member = psObject.InstanceMembers[name]; if (member == null) { PSInternalMemberSet set = new PSInternalMemberSet(name, psObject) { ShouldSerialize = false, isHidden = true, isReservedMember = true }; member = set; psObject.InstanceMembers.Add(member); member.instance = psObject; } return member; }
private static object GenerateMemberSet(string name, object obj) { PSObject psObject = PSObject.AsPSObject(obj); PSMemberInfo member = psObject.InstanceMembers[name]; if (member == null) { PSInternalMemberSet set = new PSInternalMemberSet(name, psObject) { ShouldSerialize = false, isHidden = true, isReservedMember = true }; member = set; psObject.InstanceMembers.Add(member); member.instance = psObject; } return(member); }