I am trying to access a hash table by name, which is passed through a parameter.
Ref.
TestScript.Ps1 -specify TestDomain1,TestDomain2
Contents of TestScript.ps1:
param( [string[]]$specify ) $TestDomain1 = @{"Name" = "Test1", "Hour" = 1} $TestDomain2 = @{"Name" = "Test2", "Hour" = 2} foreach($a in $specify) { write-host $($a).Name
Is there any other way to do this to get these values? Is there a better method than using hash tables? Any help would be appreciated.
source share