I am probably being completely stupid but this is driving me crazy,
I have two variables one from a loop of a text file ‘$Server’ and the other the results from a scriptblock ‘$CurrentSystem’
I want to add these two variables into a new variable called '$FinalList
So I write '$FinalList += $Server += $CurrentSystem
However I receive the dreaded 'Method invocation failed because [System.Management.Automation.PSObject] does not contain a method named ‘op_Addition’. message.
I have already called the vriables as array variables $FinalList = @() etc.
I have read a few articles on how to add these two objects together into a new variable but none of them seem to be doing what I require here.
What do you think?