I am trying to write a Pwoershell script to get the values/attributes for each objectID as shown below, from my research a hash table would work, but this appears to work as a key pair, I need to fetch the 3rd attribute i.e Role.
At this stage, a simply foreach loop printing all the 3 different dimension values would be ideal, In the example below, I can get the ObjectID and the type, but I need a way to get the Role for each objectID
Role: Administrator
Type: Group
ObjectID: 982c-4ed0-ac15-d52f357f01454ee96d4e
Example
$hash = @{
'982c-4ed0-ac15-d52f357f01454ee96d4e' = 'Group'
'4ed0-ac15-d52f357f' = 'ServicePrincipal'
}
$hash.getEnumerator() | foreach {
Write-Host ("Key = " + $_.key + " and Value = " + $_.value);
}
Is it also possible to have this passed as a parameter to a PowerShell script file.
Thanks in advance.