Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Hi I have 2 custom PS objects let’s say objA and objB with multiple members in each custom object. The only thing the same about each object is the computer name. Foreach computer name match I want to take one member from objB and add it to objA. The only issue is it is adding everything into that one column. I tried a foreach but it does the same thing. I am thinking I have to iterate through one of the objects.
This adding everything into one memeber. I just need to take what is ever matching by computer name between ObjA and ObjB and add the missing member to ObjA from ObjB.
ObjA:
ComputerName : computer1
name : A
numbers : 1000
File2 : Path2
File3 : Path3
ObjB:
ComputerName : computer1
Letter : b
Soruce : 1000
File1 : Path1
memeber added to ObjA from ObjB:
ComputerName : computer1
name : A
numbers : 1000
File2 : Path2
File3 : Path3 File1 : Path1
You have to have an accurate representation of what you are trying to do. The code you posted was for two single objects. If there are multiples then you will have to enumerate them correctly.
This topic is 6 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.