Below is my code. I would like to add then read individual values.
$ht = @{
'Hcohesity01' = @{
'Audit' = 1
'Block' = 2
'Change' = 3
'percentage' = @{
'server1' = 4
'server2' = 5
'server3' = 10
}
}
'Hcohesity02' = @{
'Audit' = 1
'Block' = 2
'Change' = 3
'percentage' = @{
'server1' = 4
'server2' = 5
'server3' = 10
}
}
}
$ht['Hcohesity02']['percentage']['server4'] = 20
foreach ( $value -in $ht['Hcohesity02']['percentage'].Values){
$server5 += $value
}
$ht['Hcohesity02']['percentage']['server5'] =$server5
$ht['Hcohesity02']['percentage']
Below code is not working , any idea ? foreach ( $value -in $ht['Hcohesity02']['percentage'].Values)