Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell - Creating hashtable from arrays

$
0
0

Howdy,

I am working on a script, and I have ended up with two arrays like so:

$servers = @("ServerX","ServerY")

$reportID = @(123456,098765)

Given the two simple arrays above, how would I combine into a single hashtable where the servers are the key, and the reportID is the value?

Key, Value

Server X, 123456

Server Y,  098765

Thank you!!



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>