I have a script that converts the lun SerialNumber to hex form for comparison with lun guids in servers that are using the luns.
There is an option to select (1) only those with path matching a wildcard '*xxx* ' or (2) all luns.
The critial statements are
(1) $objlist = get-nclun | where {$_.path -like '*xxx*'} | select Path,SerialNumber,Size
(2) $objlist = get-nclun | select Path,SerialNumber,Size
When I process the list of objects, ie $objlist | % { <do some magic> }
Case (1) - the desired results. SerialNumber is there.
Case (2) - The SerialNumber attribute is missing
How can I force the return of the desired fields in both cases?