# make sure you have exactly ONE object $info = Get-ComputerInfo # find names of non-empty properties $filledProperties = $info.PSObject.Properties.Name.Where{![string]::IsNullOrWhiteSpace($info.$_)} | Sort-Object # turn object into a hash table and show in a grid view window $filledProperties | ForEach-Object { $hash = [Ordered]@{} } { $hash[$_] = $info.$_ } { $hash } | Out-GridView
# get all WMI information $os = Get-CimInstance-ClassName Win32_OperatingSystem # find names of non-empty properties $filledProperties = $os.PSObject.Properties.Name.Where{![string]::IsNullOrWhiteSpace($os.$_)} | Sort-Object # show non-empty properties only $os | Select-Object-Property$filledProperties