Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes automatic members in all PowerShell objects
Locale: en-US
ms.date: 01/24/2023
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_Inrinsic_Members?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Intrinsic_Members
Expand Down Expand Up @@ -163,9 +163,20 @@ information on how to use these methods, see [about_Arrays][01].
## Properties

The **Count** and **Length** properties are available to all PowerShell
objects. These are similar to each other but may work differently depending on
the data type. For more information about these properties, see
[about_Properties][04].
objects, not just collections. These are similar to each other but may work
differently depending on the data type. For example, the **Length** of a string
is the number of characters in the string. The **Count** property is the number
of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

For more information about these properties, see [about_Properties][04].

## Array indexing scalar types

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to use object properties in PowerShell.
Locale: en-US
ms.date: 07/18/2022
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_properties?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Properties
Expand Down Expand Up @@ -252,8 +252,8 @@ the collection.
176
```

Starting in PowerShell 3.0, if you request the **Count** or **Length** property
of zero objects or one object, PowerShell returns the correct value.
Starting in PowerShell 3.0, you can get the **Count** or **Length** property of
singleton objects that aren't collections.

```powershell
(Get-Service Audiosrv).Count
Expand All @@ -263,6 +263,18 @@ of zero objects or one object, PowerShell returns the correct value.
1
```

However, some objects have a **Length** property. For example, the **Length**
of a string is the number of characters in the string. The **Count** property
is the number of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

If a property exists on the individual objects and on the collection, only the
collection's property is returned.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes automatic members in all PowerShell objects
Locale: en-US
ms.date: 01/24/2023
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_Inrinsic_Members?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Intrinsic_Members
Expand Down Expand Up @@ -163,9 +163,20 @@ information on how to use these methods, see [about_Arrays][01].
## Properties

The **Count** and **Length** properties are available to all PowerShell
objects. These are similar to each other but may work differently depending on
the data type. For more information about these properties, see
[about_Properties][04].
objects, not just collections. These are similar to each other but may work
differently depending on the data type. For example, the **Length** of a string
is the number of characters in the string. The **Count** property is the number
of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

For more information about these properties, see [about_Properties][04].

## Array indexing scalar types

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to use object properties in PowerShell.
Locale: en-US
ms.date: 07/18/2022
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_properties?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Properties
Expand Down Expand Up @@ -252,8 +252,8 @@ the collection.
176
```

Starting in PowerShell 3.0, if you request the **Count** or **Length** property
of zero objects or one object, PowerShell returns the correct value.
Starting in PowerShell 3.0, you can get the **Count** or **Length** property of
singleton objects that aren't collections.

```powershell
(Get-Service Audiosrv).Count
Expand All @@ -263,6 +263,18 @@ of zero objects or one object, PowerShell returns the correct value.
1
```

However, some objects have a **Length** property. For example, the **Length**
of a string is the number of characters in the string. The **Count** property
is the number of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

If a property exists on the individual objects and on the collection, only the
collection's property is returned.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes automatic members in all PowerShell objects
Locale: en-US
ms.date: 01/24/2023
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_Inrinsic_Members?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Intrinsic_Members
Expand Down Expand Up @@ -163,9 +163,20 @@ information on how to use these methods, see [about_Arrays][01].
## Properties

The **Count** and **Length** properties are available to all PowerShell
objects. These are similar to each other but may work differently depending on
the data type. For more information about these properties, see
[about_Properties][04].
objects, not just collections. These are similar to each other but may work
differently depending on the data type. For example, the **Length** of a string
is the number of characters in the string. The **Count** property is the number
of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

For more information about these properties, see [about_Properties][04].

## Array indexing scalar types

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to use object properties in PowerShell.
Locale: en-US
ms.date: 07/18/2022
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_properties?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Properties
Expand Down Expand Up @@ -253,8 +253,8 @@ the collection.
176
```

Starting in PowerShell 3.0, if you request the **Count** or **Length** property
of zero objects or one object, PowerShell returns the correct value.
Starting in PowerShell 3.0, you can get the **Count** or **Length** property of
singleton objects that aren't collections.

```powershell
(Get-Service Audiosrv).Count
Expand All @@ -264,6 +264,18 @@ of zero objects or one object, PowerShell returns the correct value.
1
```

However, some objects have a **Length** property. For example, the **Length**
of a string is the number of characters in the string. The **Count** property
is the number of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

If a property exists on the individual objects and on the collection, only the
collection's property is returned.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes automatic members in all PowerShell objects
Locale: en-US
ms.date: 01/24/2023
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_Inrinsic_Members?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Intrinsic_Members
Expand Down Expand Up @@ -163,9 +163,20 @@ information on how to use these methods, see [about_Arrays][01].
## Properties

The **Count** and **Length** properties are available to all PowerShell
objects. These are similar to each other but may work differently depending on
the data type. For more information about these properties, see
[about_Properties][04].
objects, not just collections. These are similar to each other but may work
differently depending on the data type. For example, the **Length** of a string
is the number of characters in the string. The **Count** property is the number
of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

For more information about these properties, see [about_Properties][04].

## Array indexing scalar types

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes how to use object properties in PowerShell.
Locale: en-US
ms.date: 07/18/2022
ms.date: 08/21/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_properties?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Properties
Expand Down Expand Up @@ -253,8 +253,8 @@ the collection.
176
```

Starting in PowerShell 3.0, if you request the **Count** or **Length** property
of zero objects or one object, PowerShell returns the correct value.
Starting in PowerShell 3.0, you can get the **Count** or **Length** property of
singleton objects that aren't collections.

```powershell
(Get-Service Audiosrv).Count
Expand All @@ -264,6 +264,18 @@ of zero objects or one object, PowerShell returns the correct value.
1
```

However, some objects have a **Length** property. For example, the **Length**
of a string is the number of characters in the string. The **Count** property
is the number of instances of the object.

```powershell
PS> $str = 'string'
PS> $str.Length
6
PS> $str.Count
1
```

If a property exists on the individual objects and on the collection, only the
collection's property is returned.

Expand Down