@Richard - I am wanting an output as an array of strings and not an array of objects.
This is just academic tinkering mostly and figuring out how I can write this in the shortest way possible yet account for the instances when, for example, an array may contain 1,000,000+ items.
@Richard So far, I’ve tried your suggestion which was 20 seconds. I tried Dave’s suggestion and that was about the same. I also tried mine and it was about the same too. In this instance, it appears since they are the same performance-wise it’d be best to pick the shortest code which would be
(Get-Wmiobject -Class CIM_DataFile | Select -first 20000).DeviceID.TrimEnd(‘:’)
Am I right?