I'm attempting to use PowerShell to create a hash table where the key is a servername which has multiple values some of which are arrays.
Key = SERVERNAME
Values:
ServerID (Single ID value)
GroupIDs (array of ID values, which tie to a specific group name below)
GroupName (Array of values, which ties to specific group ID from array above)
I'm iterating through a list of servers and attempting to build this out.
$ServerHashTable = @{}
$ServerHashTable.ServerName = @()
$ServerHashTable.ServerID = @()
$ServerHashTable.GroupName = @()
$ServerHashTable.GroupID = @()
$ServerHashTable.ServerName += $ServerName
$ServerHashTable.ServerID += $ServerID
$ServerHashTable.GroupName += $GroupName
$ServerHashTable.GroupID += $GroupID
The issue I have is that the key doesn't appear to be the servername and I'm not sure how to link the GroupID's and GroupNames as I add them.
Thanks for any help with this