Skip to content

Commit

Permalink
(GH-8618) Add note to Measure-Object in 7.3 (#8638)
Browse files Browse the repository at this point in the history
* (GH-8618) Add note to Measure-Object in 7.3

This commit adds a note to the `Measure-Object` cmdlet reference
documentation for PowerShell 7.3 to clarify that it now only returns
an argument error when an object is missing the to-measure property
in **StrictMode** to pair with the updated implementation from
PowerShell/PowerShell#16589.

* Address review feedback.

Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>

Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
  • Loading branch information
michaeltlombardi and sdwheeler committed Mar 9, 2022
1 parent 446f0e7 commit d946fe4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reference/7.3/Microsoft.PowerShell.Utility/Measure-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Utility
ms.date: 07/15/2021
ms.date: 03/08/2022
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/measure-object?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Measure-Object
Expand Down Expand Up @@ -546,6 +546,12 @@ Otherwise, it returns a **GenericMeasureInfo** object.

## NOTES

Starting in PowerShell 7.3, `Measure-Object` no longer returns an error when
processing an object that is missing the property being measured unless you are
running in **StrictMode**. In **StrictMode**, `Measure-Object` returns a
`System.Management.Automation.PSArgumentException` when processing an object
that is missing the specified property.

## RELATED LINKS

[about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md)
Expand Down

0 comments on commit d946fe4

Please sign in to comment.