for example, if i run the code below, $ProgramName is a string not a array which i want. How can i take the value of $cncprograms and add it to $ProgramName retaining the array type?
$ProgramName =@()
$ProgramName = JOHN
$cncPrograms = DOH
$ProgramName += $cncPrograms
this is what you need:
in your code you are re-assign a string value to the variable:
$ProgramName = "JOHN"# now the variable is of type string (no more an [object[]] object array)that’s way
$ProgramName += $cncProgramsgive a result of “JOHNDOH”