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
* Update extending-output-objects.md
- removing duplicate sentences and paragraphs
- marking output of Get-Member -InputObject ... as code (type output), since original formatting messes up line breaks
* Update extending-output-objects.md
- Removed duplicated sentence
- Changed ps prompt to be consistent
- Proper cased PowerShell parameters and properties
- Minor markdown fixes
Copy file name to clipboardExpand all lines: developer/cmdlet/extending-output-objects.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,34 +30,37 @@ The following example shows how Windows PowerShell extends the [System.Array](/d
30
30
31
31
```
32
32
33
-
To see this new alias property, use a [Get-Member](/powershell/module/Microsoft.PowerShell.Utility/Get-Member) command on any array, as shown in the following example.
34
33
To see this new alias property, use a [Get-Member](/powershell/module/Microsoft.PowerShell.Utility/Get-Member) command on any array, as shown in the following example.
**Length Property System.Int32 Length {get;}** You can use either the `Count` property or the `Length` property to determine how many objects are in an array. For example:
50
-
51
-
```python
52
-
PS> (1, 2, 3, 4).count
54
+
```powershell
55
+
PS> (1, 2, 3, 4).Count
53
56
```
54
57
55
58
```output
56
59
4
57
60
```
58
61
59
-
```python
60
-
(1, 2, 3, 4).length
62
+
```powershell
63
+
PS> (1, 2, 3, 4).Length
61
64
```
62
65
63
66
```output
@@ -66,7 +69,7 @@ PS> (1, 2, 3, 4).count
66
69
67
70
## Custom Types Files
68
71
69
-
To create a custom types file, start by copying an existing types file. The new file can have any name, but it must have a .ps1xml file name extension. When you copy the file, you can place the new file in any directory that is accessible to Windows PowerShell, but it is useful to place the files in the Windows PowerShell installation directory `($pshome`) or in a subdirectory of the installation directory.
72
+
To create a custom types file, start by copying an existing types file. The new file can have any name, but it must have a .ps1xml file name extension. When you copy the file, you can place the new file in any directory that is accessible to Windows PowerShell, but it is useful to place the files in the Windows PowerShell installation directory (`$pshome`) or in a subdirectory of the installation directory.
70
73
71
74
To add your own extended types to the file, add a types element for each object that you want to extend. The following topics provide examples.
72
75
@@ -79,14 +82,10 @@ To add your own extended types to the file, add a types element for each object
79
82
After you define your own extended types, use one of the following methods to make your extended objects available:
80
83
81
84
- To make your extended types file available to the current session, use the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) cmdlet to add the new file. If you want your types to take precedence over the types that are defined in other types files (including the Types.ps1xml file), use the `PrependData` parameter of the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) cmdlet.
82
-
- To make your extended types file available to the current session, use the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) cmdlet to add the new file. If you want your types to take precedence over the types that are defined in other types files (including the Types.ps1xml file), use the `PrependData` parameter of the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) cmdlet.
83
-
84
-
To make your extended types file available to all future sessions, add the types file to a module, export the current session, or add the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) command to your Windows PowerShell profile.
85
-
To make your extended types file available to all future sessions, add the types file to a module, export the current session, or add the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) command to your Windows PowerShell profile.
85
+
- To make your extended types file available to all future sessions, add the types file to a module, export the current session, or add the [Update-TypeData](/powershell/module/Microsoft.PowerShell.Utility/Update-TypeData) command to your Windows PowerShell profile.
86
86
87
87
## Signing Types Files
88
88
89
-
Types files should be digitally signed to prevent tampering because the XML can include script blocks. For more information about adding digital signatures, see [about_Signing](/powershell/module/microsoft.powershell.core/about/about_signing)
90
89
Types files should be digitally signed to prevent tampering because the XML can include script blocks. For more information about adding digital signatures, see [about_Signing](/powershell/module/microsoft.powershell.core/about/about_signing)
0 commit comments