I have the following array (as part of a script) which content looks like that:
Arr[0] -> "$var1 = c:\Temp\aaa"
Arr[1] -> "$var2 = c:\Temp\abc"
Arr[2] -> "$var3 = c:\Temp\abc\xyz"
I'd like to be able to use all array elements in my script.
Is it possible to load array elements to memory and use them in another script as defined variables?
Please note, variables are not part of the script.
I build them into the array and it is stored there.
For example (running on another script):
Copy-Item -Path $var1 -Destination $var2