still very inexperienced in Powershell, but as is well known, every journey begins with the first steps.
I define two arrays in the script:
$array1 = @("server1", "server2")
$array2 = @("SID1", "SID2")
The SID1 and server1 belong together.
I then want to combine the two arrays using a loop: Example:
foreach ($i in $array1) {
Write-Host "Server = ${i}"
}
How can I combine the two arrays? Ideal is: ...
Write-Host "Server=${i}" and SID=${?}"
...
Can the two arrays be built into the foreach so that both values are filled when executing on the write host?
Thanks for your ideas and help.
Many greetings
Carlos