1

I have 5 hash tables:

$Monday = @{RUG = "";NRH1 = "";NRH2 = "";ELM = "";BAGVAGT = ""}
$Tuesday = @{RUG = "";NRH1 = "";NRH2 = "";ELM = "";BAGVAGT = ""}
$Wednesday = @{NRH1 = "";NRH2 = "";ELM = "";BAGVAGT = ""}
$Thursday = @{NRH1 = "";NRH2 = "";ELM = "";BAGVAGT = ""}
$Friday = @{NRH1 = "";NRH2 = "";ELM = ""}

That get filled with data. And I can get data out from these either one at at time with $Monday.RUG or all with $Monday | out-string. No problem there.

I'm going to combine those in another hash table 100 times with different data. So it will be like this:

$Week = @{
1 = @{mo=$Monday;tu=$Tuesday;we=$Wednesday;th=$Thursday;fr=$Friday;val=$value}
2 = @{mo=$Monday;tu=$Tuesday;we=$Wednesday;th=$Thursday;fr=$Friday;val=$value}
}

And so on, until I have 100 different weeks with different values (value will be a calculated number)

But the question is. How do I access the items in the hashtables inside the $week hashtable?

Is there a direct way like $week.1.mo ? or do you need to use a loop?

1 Answer 1

1

You can access it using:

$Week[1].mo 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.