Select-Object reports an error when -ExpandProperty is used on a hashtable member that is not a key.
Version:
PowerShell 7 Preview 5
Reproduce:
$PSVersionTable | Select-Object -expandProperty Keys
Expected Result:
[list of hashtable keys]
Actual Result:
Exception:
Select-Object: Property "count" cannot be found.
Workaround:
$PSVersionTable | ForEach-Object { $_.Keys }
Details:
https://powershell.one/bugs/powershell-7/select-object
Select-Object reports an error when -ExpandProperty is used on a hashtable member that is not a key.
Version:
PowerShell 7 Preview 5
Reproduce:
$PSVersionTable | Select-Object -expandProperty Keys
Expected Result:
[list of hashtable keys]
Actual Result:
Exception:
Select-Object: Property "count" cannot be found.
Workaround:
$PSVersionTable | ForEach-Object { $_.Keys }
Details:
https://powershell.one/bugs/powershell-7/select-object