-ExpandProperty is a Select-Object parameter that outputs the values of a specified property instead of objects containing that property.
Select-Object -ExpandProperty extracts the values of a named property and sends those simple values through the pipeline instead of returning objects that merely contain the property. section 10.8
Pass a resource-group name to another cmdlet
Get-AzResourceGroup -Location westus2 | Select-Object -First 1 -ExpandProperty ResourceGroupName returns a resource-group name as a string. That value can feed New-AzStorageAccount -ResourceGroupName, unlike the original PSResourceGroup object or a custom object made with -Property. section 10.8
See the difference
Compare Get-Date | Select-Object -Property DayOfWeek with Get-Date | Select-Object -ExpandProperty DayOfWeek: the first produces an object containing DayOfWeek, while the second outputs the property value. section 10.11
How Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS covers it
How deep it goes
Explains object-versus-value output and parameter compatibility, while stopping short of deeper pipeline internals.
Select-Objectpart of · Select-Object is a PowerShell cmdlet that selects properties or creates customized objects from input objects.
This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS. The section links point to the parts of the book it draws on.