Hi
im trying to find the best way to lookup item inside hashtable:
$data1|gm
TypeName: Deserialized.System.Collections.Hashtable
items look like this:
$data1|select -First 1
Name Value
---- -----
manufacturer LENOVO
id 8e9b9c0b-da9d-4ce5-acab-226ea80f57fes
userPrincipalName
lastContactedDateTime 8/4/2023 12:36:36 AM
azureActiveDirectoryDeviceId f8ef7209-6965-4e11-a245-167ae1rew054cf
enrollmentState enrolled
model 20R6S2KE0EQW
serialNumber PC1Q28KTRED
displayName
systemFamily ThinkPad L13 Yoga Gen 1
purchaseOrderIdentifier 0157875611
managedDeviceId aad154d7-6323-4c7d-8d09f-83d565514702
addressableUserName
productKey 3305556973834
groupTag CYTCNA
skuNumber LENOVO_MT_20R6_BU_Think_FM_ThinkPad L13 Yoga Gen 1
this works and returns the item and its all its properties but is slow method:
$data1.({$_.'serial number' -eq 'PC1Q28KTRED'})
but when trying this:
$data1["PC1Q28KTRED"]
or this:
$data1.PC1Q28KTRED
any idea what am i missing here?
Thanks