I am trying to name an array after the value from another variable, and then add multiple items to it by referring to it with the value from mentioned variable.
For example, I can do the following:
PS C:\Users\Administrator> $IP_Address = "100.100.100.5"
PS C:\Users\Administrator> New-Variable -Name $IP_Address
PS C:\Users\Administrator> Set-Variable -Name $IP_Address -Value "Test string"
PS C:\Users\Administrator> Get-Variable -Name 100.100.100.5
Name Value
---- -----
100.100.100.5 Test string
PS C:\Users\Administrator> ${100.100.100.5}
Test string
But I cannot figure out how to add items into the variable ${100.100.100.5} by refering to it using $IP_Address.