Skip to content

Commit 9e0342e

Browse files
committed
Incorporate feedback
1 parent 569b4db commit 9e0342e

4 files changed

Lines changed: 28 additions & 12 deletions

File tree

reference/5.1/Microsoft.PowerShell.Core/About/about_Operators.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,19 @@ that doesn't have the member, PowerShell automatically enumerates the items in
587587
that collection and uses the operator on each of them. For more information,
588588
see [about_Member-Access_Enumeration][14].
589589

590-
When you access a member that doesn't exist or could throw an exception,
591-
PowerShell returns `$null` instead of throwing an error. This behavior follows
592-
.NET CA rule [CA1065][02] that states:
590+
When you use the member-access operator to read a property that doesn't exist,
591+
or when a property getter method throws an exception, PowerShell returns
592+
`$null` instead of throwing an error. This behavior is specific to property
593+
access. This behavior follows .NET CA rule [CA1065][02] that states:
593594

594595
> Properties are basically smart fields. Therefore, they should behave like a
595596
> field as much as possible. Fields don't throw exceptions and neither should
596597
> properties. If you have a property that throws an exception, consider making
597598
> it a method.
598599
600+
Exceptions thrown by method invocations (including calling the underlying
601+
`get_<PropertyName()>` method directly) aren't suppressed.
602+
599603
### Static member operator `::`
600604

601605
Calls the static properties and methods of a .NET class. To find the static

reference/7.4/Microsoft.PowerShell.Core/About/about_Operators.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,15 +716,19 @@ that doesn't have the member, PowerShell automatically enumerates the items in
716716
that collection and uses the operator on each of them. For more information,
717717
see [about_Member-Access_Enumeration][14].
718718

719-
When you access a member that doesn't exist or could throw an exception,
720-
PowerShell returns `$null` instead of throwing an error. This behavior follows
721-
.NET CA rule [CA1065][02] that states:
719+
When you use the member-access operator to read a property that doesn't exist,
720+
or when a property getter method throws an exception, PowerShell returns
721+
`$null` instead of throwing an error. This behavior is specific to property
722+
access. This behavior follows .NET CA rule [CA1065][02] that states:
722723

723724
> Properties are basically smart fields. Therefore, they should behave like a
724725
> field as much as possible. Fields don't throw exceptions and neither should
725726
> properties. If you have a property that throws an exception, consider making
726727
> it a method.
727728
729+
Exceptions thrown by method invocations (including calling the underlying
730+
`get_<PropertyName()>` method directly) aren't suppressed.
731+
728732
### Static member operator `::`
729733

730734
Calls the static properties and methods of a .NET class. To find the static

reference/7.5/Microsoft.PowerShell.Core/About/about_Operators.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,15 +716,19 @@ that doesn't have the member, PowerShell automatically enumerates the items in
716716
that collection and uses the operator on each of them. For more information,
717717
see [about_Member-Access_Enumeration][14].
718718

719-
When you access a member that doesn't exist or could throw an exception,
720-
PowerShell returns `$null` instead of throwing an error. This behavior follows
721-
.NET CA rule [CA1065][02] that states:
719+
When you use the member-access operator to read a property that doesn't exist,
720+
or when a property getter method throws an exception, PowerShell returns
721+
`$null` instead of throwing an error. This behavior is specific to property
722+
access. This behavior follows .NET CA rule [CA1065][02] that states:
722723

723724
> Properties are basically smart fields. Therefore, they should behave like a
724725
> field as much as possible. Fields don't throw exceptions and neither should
725726
> properties. If you have a property that throws an exception, consider making
726727
> it a method.
727728
729+
Exceptions thrown by method invocations (including calling the underlying
730+
`get_<PropertyName()>` method directly) aren't suppressed.
731+
728732
### Static member operator `::`
729733

730734
Calls the static properties and methods of a .NET class. To find the static

reference/7.6/Microsoft.PowerShell.Core/About/about_Operators.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,15 +716,19 @@ that doesn't have the member, PowerShell automatically enumerates the items in
716716
that collection and uses the operator on each of them. For more information,
717717
see [about_Member-Access_Enumeration][14].
718718

719-
When you access a member that doesn't exist or could throw an exception,
720-
PowerShell returns `$null` instead of throwing an error. This behavior follows
721-
.NET CA rule [CA1065][02] that states:
719+
When you use the member-access operator to read a property that doesn't exist,
720+
or when a property getter method throws an exception, PowerShell returns
721+
`$null` instead of throwing an error. This behavior is specific to property
722+
access. This behavior follows .NET CA rule [CA1065][02] that states:
722723

723724
> Properties are basically smart fields. Therefore, they should behave like a
724725
> field as much as possible. Fields don't throw exceptions and neither should
725726
> properties. If you have a property that throws an exception, consider making
726727
> it a method.
727728
729+
Exceptions thrown by method invocations (including calling the underlying
730+
`get_<PropertyName()>` method directly) aren't suppressed.
731+
728732
### Static member operator `::`
729733

730734
Calls the static properties and methods of a .NET class. To find the static

0 commit comments

Comments
 (0)