You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/document/Skill/PowerShell/docs/Language/PSCustomObject.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,15 @@ The must-know is **`[PSCustomObject]` maps to the same type as `[psobject]`, `Sy
17
17
The only valid usage is marking one HashTable as `System.Management.Automation.PSCustomObject`. Other possible usages of `[PSCustomObject]` is bascially pointless.
18
18
19
19
> [!WARNING]
20
-
> Do not use `PSCustomObject` case-sensitive keys matters, name of extended properties are not case-sensitive, use `HashTable` instead.
20
+
> Do not use `PSCustomObject`if case-sensitive keys matter, name of extended properties are not case-sensitive, use `HashTable` instead.
21
21
22
22
## Creation
23
23
24
24
PSCustomObject borrows the syntax from HashTable with a casting.
Copy file name to clipboardExpand all lines: docs/document/Skill/PowerShell/docs/Object Manipulation/5.Select.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The following is a overview:
10
10
- Take a count from start or end with `-First` or `-Last`.
11
11
- Skip a count from start or end `-Skip` or `-SkipLast`.
12
12
- Cherry-Pick one or more items by zero-based index.
13
-
- Distinct items selected from pipline.
13
+
- Distinct items selected from pipeline.
14
14
15
15
> [!TIP]
16
16
> Use `select` alias for `Select-Object`.
@@ -104,7 +104,7 @@ gps | select -ExpandProperty Name
104
104
`-ExpandProperty` can be used together with `-Property`, selected properties by `-Property` will be added as **NoteProperty** to the selected `-ExpandProperty`.
105
105
106
106
> [!WARNING]
107
-
> This approach mutates the selected property instead of generating a new object.
107
+
> This approach mutates the selected property for `-ExpandProperty` instead of generating a new object.
108
108
109
109
```ps1
110
110
$player = @{
@@ -119,14 +119,14 @@ $player = @{
119
119
}
120
120
121
121
# Adds a NoteProperty `Status` with the same value from $player to $player.Partner
122
-
$partner = $john | select Status -ExpandProperty Partner
122
+
$partner = $player | select Status -ExpandProperty Partner
Intrinsic methods and properties are to mimic singular object and collection in a same form.
42
58
- `Where`: a method for filtering or slicing by condition. See [Where](../Object Manipulation/3.Where.md)
43
59
- `ForEach`: a method to perform iteration with certain logic or perform casting all items to target type. See [ForEach](../Object Manipulation/4.ForEach.md#Intrinsic%20ForEach)
0 commit comments