Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchen authored Dec 9, 2024
1 parent 180e5c7 commit da5ed0c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/document/PowerShell/docs/Object Manipulation/Select.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ README.md 0.85
### Select Value Only

To select single value of a property instead of being wrapped as an object, use `-ExpandProperty`.
The return type is still an `object[]` since there's no generic resolution on Powershell.
But each memeber should be string indeed in the following snippet.
The return type is still an `object[]`. But each memeber should be string indeed in the following snippet.

```ps1
gps | select -ExpandProperty Name
Expand All @@ -85,7 +84,7 @@ gps | select -ExpandProperty Name
```

> [!NOTE]
> `Foreach-Object` can achieve the same thing
> `ForEach-Object` can achieve the same thing
> ```ps1
> gps | foreach Name
> # or use another alias of ForEach-Object %
Expand Down Expand Up @@ -132,7 +131,7 @@ $partner['Status'] # Poisoned
- `Expression`(`E`): the calculation logic for the new property represented as a script block.

```ps1
$person = @{
$person = [pscustomobject]@{
FirstName = 'John'
LastName = 'Smith'
}
Expand Down

0 comments on commit da5ed0c

Please sign in to comment.