Skip to content

Commit dde1d1f

Browse files
purdo17DCtheGeek
authored andcommitted
Update extending-output-objects.md (#2618)
* 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
1 parent ec79ab5 commit dde1d1f

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

developer/cmdlet/extending-output-objects.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,37 @@ The following example shows how Windows PowerShell extends the [System.Array](/d
3030

3131
```
3232

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.
3433
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.
3534

36-
**Get-Member -inputobject (1,2,3,4)**
35+
```powershell
36+
Get-Member -InputObject (1,2,3,4)
37+
```
3738

3839
The command returns the following results.
40+
```output
41+
Name MemberType Definition
42+
---- ---------- ----------
43+
Count AliasProperty Count = Length
44+
Address Method System.Object& Address(Int32 )
45+
Clone Method System.Object Clone()
46+
CopyTo Method System.Void CopyTo(Array array, Int32 index):
47+
Equals Method System.Boolean Equals(Object obj)
48+
Get Method System.Object Get(Int32 )
49+
...
50+
Length Property System.Int32 Length {get;}
51+
```
52+
You can use either the `Count` property or the `Length` property to determine how many objects are in an array. For example:
3953

40-
**Name MemberType Definition**
41-
**---- ---------- ----------**
42-
**Count AliasProperty Count = Length**
43-
**Address Method System.Object& Address(Int32 )**
44-
**Clone Method System.Object Clone()**
45-
**CopyTo Method System.Void CopyTo(Array array, Int32 index):**
46-
**Equals Method System.Boolean Equals(Object obj)**
47-
**Get Method System.Object Get(Int32 )**
48-
**...**
49-
**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
5356
```
5457

5558
```output
5659
4
5760
```
5861

59-
```python
60-
(1, 2, 3, 4).length
62+
```powershell
63+
PS> (1, 2, 3, 4).Length
6164
```
6265

6366
```output
@@ -66,7 +69,7 @@ PS> (1, 2, 3, 4).count
6669

6770
## Custom Types Files
6871

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.
7073

7174
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.
7275

@@ -79,14 +82,10 @@ To add your own extended types to the file, add a types element for each object
7982
After you define your own extended types, use one of the following methods to make your extended objects available:
8083

8184
- 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.
8686

8787
## Signing Types Files
8888

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)
9089
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)
9190

9291
## See Also

0 commit comments

Comments
 (0)