From 07187147e75ed9358ed969d65f0ade983a6ad544 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 23 Apr 2025 19:48:14 -0500 Subject: [PATCH 1/3] Standardize terminology around "simplified syntax" --- .../ForEach-Object.md | 22 ++++++--- .../Microsoft.PowerShell.Core/Where-Object.md | 35 +++++++++----- .../ForEach-Object.md | 22 ++++++--- .../Microsoft.PowerShell.Core/Where-Object.md | 37 +++++++++------ .../ForEach-Object.md | 22 ++++++--- .../Microsoft.PowerShell.Core/Where-Object.md | 47 +++++++++++-------- .../ForEach-Object.md | 22 ++++++--- .../Microsoft.PowerShell.Core/Where-Object.md | 37 +++++++++------ 8 files changed, 156 insertions(+), 88 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md index 2f302762ca56..837e7f7bc3ba 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/26/2024 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ForEach-Object @@ -36,14 +36,17 @@ input objects can be piped to the cmdlet or specified using the **InputObject** Starting in Windows PowerShell 3.0, there are two different ways to construct a `ForEach-Object` command. -- **Script block**. You can use a script block to specify the operation. Within the script block, +- **Script block syntax**. You can use a script block to specify the operation. Within the script block, use the `$_` variable to represent the current object. The script block is the value of the **Process** parameter. The script block can contain any PowerShell script. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object {$_.ProcessName}` + + ```powershell + Get-Process | ForEach-Object {$_.ProcessName} + ``` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -52,14 +55,19 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Operation statement**. You can also write an operation statement, which is much more like - natural language. You can use the operation statement to specify a property value or call a - method. Operation statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in + the pipeline. `ForEach-Object` returns the value of the property or method for each object in the + the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object ProcessName` + ```powershell + Get-Process | ForEach-Object ProcessName + ``` + + The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). ## EXAMPLES diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index 35ce5bc2884c..7bffcbe38836 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/26/2024 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/where-object?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Where-Object @@ -241,32 +241,41 @@ particular version of Windows. Starting in Windows PowerShell 3.0, there are two different ways to construct a `Where-Object` command. -- **Script block**. You can use a script block to specify the property name, a comparison operator, +- **Script block syntax**. You can use a script block to specify the property name, a comparison operator, and a property value. `Where-Object` returns all objects for which the script block statement is true. - For example, the following command gets processes in the `Normal` priority class, that is, - processes where the value of the **PriorityClass** property equals `Normal`. + For example, the following command gets processes where the value of the **PriorityClass** + property equals `Normal`. - `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` + ```powershell + Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} + ``` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Comparison statement**. You can also write a comparison statement, which is much more like - natural language. Comparison statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth + parameters that represent the comparison operators. The simplified syntax is easier to read and + write than the script block syntax. You can combine one of the switch parameters with the + **Property** and **Value** parameters to create a command that filters objects based on the values of + their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - `Get-Process | Where-Object -Property PriorityClass -EQ -Value "Normal"` + ```powershell + Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ + Get-Process | Where-Object PriorityClass -EQ Normal + ``` - `Get-Process | Where-Object PriorityClass -EQ "Normal"` + As shown in the example, the parameter names **Property** and **Value** are optional. The + **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter + is a positional parameter mapped to position `1`. The switch parameter, used to specify the + comparison, can be used in any position. - Starting in Windows PowerShell 3.0, `Where-Object` adds comparison operators as parameters in a - `Where-Object` command. Unless specified, all operators are case-insensitive. Before Windows - PowerShell 3.0, the comparison operators in the PowerShell language were only usable in script - blocks. + The simplfied syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). When you provide a single **Property** to `Where-Object`, the cmdlet treats the value of the property as a boolean expression. When the value of the property's **Length** isn't zero, the diff --git a/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md index b8df403dd280..2b85e187682a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/13/2025 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: ForEach-Object @@ -45,14 +45,17 @@ input objects can be piped to the cmdlet or specified using the **InputObject** Starting in Windows PowerShell 3.0, there are two different ways to construct a `ForEach-Object` command. -- **Script block**. You can use a script block to specify the operation. Within the script block, +- **Script block syntax**. You can use a script block to specify the operation. Within the script block, use the `$_` variable to represent the current object. The script block is the value of the **Process** parameter. The script block can contain any PowerShell script. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object {$_.ProcessName}` + + ```powershell + Get-Process | ForEach-Object {$_.ProcessName} + ``` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -61,14 +64,19 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Operation statement**. You can also write an operation statement, which is much more like - natural language. You can use the operation statement to specify a property value or call a - method. Operation statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in + the pipeline. `ForEach-Object` returns the value of the property or method for each object in the + the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object ProcessName` + ```powershell + Get-Process | ForEach-Object ProcessName + ``` + + The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). - **Parallel running script block**. Beginning with PowerShell 7.0, a third parameter set is available that runs each script block in parallel. The **ThrottleLimit** parameter limits the diff --git a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md index de3d34975f8c..55c83669668d 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/26/2024 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Where-Object @@ -248,32 +248,41 @@ particular version of Windows. Starting in Windows PowerShell 3.0, there are two different ways to construct a `Where-Object` command. -- **Script block**. You can use a script block to specify the property name, a comparison operator, +- **Script block syntax**. You can use a script block to specify the property name, a comparison operator, and a property value. `Where-Object` returns all objects for which the script block statement is true. - For example, the following command gets processes in the `Normal` priority class, that is, - processes where the value of the **PriorityClass** property equals `Normal`. + For example, the following command gets processes where the value of the **PriorityClass** + property equals `Normal`. - `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` + ```powershell + Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} + ``` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Comparison statement**. You can also write a comparison statement, which is much more like - natural language. Comparison statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth + parameters that represent the comparison operators. The simplified syntax is easier to read and + write than the script block syntax. You can combine one of the switch parameters with the + **Property** and **Value** parameters to create a command that filters objects based on the values of + their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - `Get-Process | Where-Object -Property PriorityClass -EQ -Value "Normal"` + ```powershell + Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ + Get-Process | Where-Object PriorityClass -EQ Normal + ``` - `Get-Process | Where-Object PriorityClass -EQ "Normal"` + As shown in the example, the parameter names **Property** and **Value** are optional. The + **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter + is a positional parameter mapped to position `1`. The switch parameter, used to specify the + comparison, can be used in any position. - Starting in Windows PowerShell 3.0, `Where-Object` adds comparison operators as parameters in a - `Where-Object` command. Unless specified, all operators are case-insensitive. Before Windows - PowerShell 3.0, the comparison operators in the PowerShell language were only usable in script - blocks. + The simplfied syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). When you provide a single **Property** to `Where-Object`, the cmdlet treats the value of the property as a boolean expression. When the value of the property's **Length** isn't zero, the @@ -1208,4 +1217,4 @@ You can read more about these methods here [about_Arrays](./About/about_Arrays.m [Tee-Object](../Microsoft.PowerShell.Utility/Tee-Object.md) -[about_Booleans](about/about_Booleans.md) +[about_Booleans](./About/about_Booleans.md) diff --git a/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md index 5eda12fd016b..b07e04ca2342 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/13/2025 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: ForEach-Object @@ -45,14 +45,17 @@ input objects can be piped to the cmdlet or specified using the **InputObject** Starting in Windows PowerShell 3.0, there are two different ways to construct a `ForEach-Object` command. -- **Script block**. You can use a script block to specify the operation. Within the script block, +- **Script block syntax**. You can use a script block to specify the operation. Within the script block, use the `$_` variable to represent the current object. The script block is the value of the **Process** parameter. The script block can contain any PowerShell script. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object {$_.ProcessName}` + + ```powershell + Get-Process | ForEach-Object {$_.ProcessName} + ``` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -61,14 +64,19 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Operation statement**. You can also write an operation statement, which is much more like - natural language. You can use the operation statement to specify a property value or call a - method. Operation statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in + the pipeline. `ForEach-Object` returns the value of the property or method for each object in the + the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object ProcessName` + ```powershell + Get-Process | ForEach-Object ProcessName + ``` + + The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). - **Parallel running script block**. Beginning with PowerShell 7.0, a third parameter set is available that runs each script block in parallel. The **ThrottleLimit** parameter limits the diff --git a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md index ba65a734b356..41756e7b385f 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/26/2024 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Where-Object @@ -248,32 +248,41 @@ particular version of Windows. Starting in Windows PowerShell 3.0, there are two different ways to construct a `Where-Object` command. -- **Script block**. You can use a script block to specify the property name, a comparison operator, +- **Script block syntax**. You can use a script block to specify the property name, a comparison operator, and a property value. `Where-Object` returns all objects for which the script block statement is true. - For example, the following command gets processes in the `Normal` priority class, that is, - processes where the value of the **PriorityClass** property equals `Normal`. + For example, the following command gets processes where the value of the **PriorityClass** + property equals `Normal`. - `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` + ```powershell + Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} + ``` All PowerShell comparison operators are valid in the script block format. For more information, - see [about_Comparison_Operators](About/about_Comparison_Operators.md). + see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Comparison statement**. You can also write a comparison statement, which is much more like - natural language. Comparison statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth + parameters that represent the comparison operators. The simplified syntax is easier to read and + write than the script block syntax. You can combine one of the switch parameters with the + **Property** and **Value** parameters to create a command that filters objects based on the values of + their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - `Get-Process | Where-Object -Property PriorityClass -EQ -Value "Normal"` + ```powershell + Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ + Get-Process | Where-Object PriorityClass -EQ Normal + ``` - `Get-Process | Where-Object PriorityClass -EQ "Normal"` + As shown in the example, the parameter names **Property** and **Value** are optional. The + **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter + is a positional parameter mapped to position `1`. The switch parameter, used to specify the + comparison, can be used in any position. - Starting in Windows PowerShell 3.0, `Where-Object` adds comparison operators as parameters in a - `Where-Object` command. Unless specified, all operators are case-insensitive. Before Windows - PowerShell 3.0, the comparison operators in the PowerShell language were only usable in script - blocks. + The simplfied syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). When you provide a single **Property** to `Where-Object`, the cmdlet treats the value of the property as a boolean expression. When the value of the property's **Length** isn't zero, the @@ -285,7 +294,7 @@ The previous example is functionally equivalent to: - `('hi', '', 'there') | Where-Object { $_.Length -gt 0 }` For more information about how PowerShell evaluates booleans, see -[about_Booleans](About/about_Booleans.md). +[about_Booleans](about/about_Booleans.md). ## EXAMPLES @@ -400,9 +409,9 @@ The example uses the script block command format. Logical operators, such as `-a `Where-Object` command. - For more information about PowerShell logical operators, see - [about_Logical_Operators](About/about_Logical_Operators.md). + [about_Logical_Operators](./About/about_logical_operators.md). - For more information about the Updatable Help feature, see - [about_Updatable_Help](About/about_Updatable_Help.md). + [about_Updatable_Help](./About/about_Updatable_Help.md). ## PARAMETERS @@ -1188,7 +1197,7 @@ PowerShell includes the following aliases for `Where-Object`: Starting in Windows PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. -You can read more about these methods here [about_Arrays](About/about_Arrays.md) +You can read more about these methods here [about_Arrays](./About/about_Arrays.md) ## RELATED LINKS @@ -1208,4 +1217,4 @@ You can read more about these methods here [about_Arrays](About/about_Arrays.md) [Tee-Object](../Microsoft.PowerShell.Utility/Tee-Object.md) -[about_Booleans](About/about_Booleans.md) +[about_Booleans](./About/about_Booleans.md) diff --git a/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md index f07ed6c6555e..a42986953164 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/13/2025 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: ForEach-Object @@ -45,14 +45,17 @@ input objects can be piped to the cmdlet or specified using the **InputObject** Starting in Windows PowerShell 3.0, there are two different ways to construct a `ForEach-Object` command. -- **Script block**. You can use a script block to specify the operation. Within the script block, +- **Script block syntax**. You can use a script block to specify the operation. Within the script block, use the `$_` variable to represent the current object. The script block is the value of the **Process** parameter. The script block can contain any PowerShell script. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object {$_.ProcessName}` + + ```powershell + Get-Process | ForEach-Object {$_.ProcessName} + ``` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -61,14 +64,19 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Operation statement**. You can also write an operation statement, which is much more like - natural language. You can use the operation statement to specify a property value or call a - method. Operation statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in + the pipeline. `ForEach-Object` returns the value of the property or method for each object in the + the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - `Get-Process | ForEach-Object ProcessName` + ```powershell + Get-Process | ForEach-Object ProcessName + ``` + + The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). - **Parallel running script block**. Beginning with PowerShell 7.0, a third parameter set is available that runs each script block in parallel. The **ThrottleLimit** parameter limits the diff --git a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md index eabe5396f217..37276a5eff3c 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/26/2024 +ms.date: 04/23/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/where-object?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Where-Object @@ -248,32 +248,41 @@ particular version of Windows. Starting in Windows PowerShell 3.0, there are two different ways to construct a `Where-Object` command. -- **Script block**. You can use a script block to specify the property name, a comparison operator, +- **Script block syntax**. You can use a script block to specify the property name, a comparison operator, and a property value. `Where-Object` returns all objects for which the script block statement is true. - For example, the following command gets processes in the `Normal` priority class, that is, - processes where the value of the **PriorityClass** property equals `Normal`. + For example, the following command gets processes where the value of the **PriorityClass** + property equals `Normal`. - `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` + ```powershell + Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} + ``` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Comparison statement**. You can also write a comparison statement, which is much more like - natural language. Comparison statements were introduced in Windows PowerShell 3.0. +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth + parameters that represent the comparison operators. The simplified syntax is easier to read and + write than the script block syntax. You can combine one of the switch parameters with the + **Property** and **Value** parameters to create a command that filters objects based on the values of + their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - `Get-Process | Where-Object -Property PriorityClass -EQ -Value "Normal"` + ```powershell + Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ + Get-Process | Where-Object PriorityClass -EQ Normal + ``` - `Get-Process | Where-Object PriorityClass -EQ "Normal"` + As shown in the example, the parameter names **Property** and **Value** are optional. The + **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter + is a positional parameter mapped to position `1`. The switch parameter, used to specify the + comparison, can be used in any position. - Starting in Windows PowerShell 3.0, `Where-Object` adds comparison operators as parameters in a - `Where-Object` command. Unless specified, all operators are case-insensitive. Before Windows - PowerShell 3.0, the comparison operators in the PowerShell language were only usable in script - blocks. + The simplfied syntax was introduced in Windows PowerShell 3.0. For more information, see + [about_Simplified_Syntax](About/about_Simplified_Syntax.md). When you provide a single **Property** to `Where-Object`, the cmdlet treats the value of the property as a boolean expression. When the value of the property's **Length** isn't zero, the @@ -1208,4 +1217,4 @@ You can read more about these methods here [about_Arrays](./About/about_Arrays.m [Tee-Object](../Microsoft.PowerShell.Utility/Tee-Object.md) -[about_Booleans](about/about_Booleans.md) +[about_Booleans](./About/about_Booleans.md) From 35666e8fb62582bf1938a6da5622faa1be95a709 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 23 Apr 2025 20:03:39 -0500 Subject: [PATCH 2/3] Fix build error --- .../Microsoft.PowerShell.Core/ForEach-Object.md | 16 ++++++---------- .../Microsoft.PowerShell.Core/Where-Object.md | 13 +++++-------- .../Microsoft.PowerShell.Core/ForEach-Object.md | 16 ++++++---------- .../Microsoft.PowerShell.Core/Where-Object.md | 11 ++++------- .../Microsoft.PowerShell.Core/ForEach-Object.md | 16 ++++++---------- .../Microsoft.PowerShell.Core/Where-Object.md | 11 ++++------- .../Microsoft.PowerShell.Core/ForEach-Object.md | 16 ++++++---------- .../Microsoft.PowerShell.Core/Where-Object.md | 11 ++++------- 8 files changed, 41 insertions(+), 69 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md index 837e7f7bc3ba..351d2fa53796 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md @@ -43,10 +43,7 @@ command. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - - ```powershell - Get-Process | ForEach-Object {$_.ProcessName} - ``` + `Get-Process | ForEach-Object {$_.ProcessName}` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -57,14 +54,12 @@ command. - **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - the pipeline. + pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - ```powershell - Get-Process | ForEach-Object ProcessName - ``` + `Get-Process | ForEach-Object ProcessName` The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see [about_Simplified_Syntax](About/about_Simplified_Syntax.md). @@ -90,8 +85,9 @@ This example takes an array of three integers and divides each one of them by 10 This example processes the files and directories in the PowerShell installation directory `$PSHOME`. ```powershell -Get-ChildItem $PSHOME | - ForEach-Object -Process {if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " }} +Get-ChildItem $PSHOME | ForEach-Object -Process { + if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " } +} ``` If the object isn't a directory, the script block gets the name of the file, divides the value of diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index 7bffcbe38836..11608415354b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -248,9 +248,7 @@ command. For example, the following command gets processes where the value of the **PriorityClass** property equals `Normal`. - ```powershell - Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} - ``` + `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). @@ -264,10 +262,9 @@ command. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - ```powershell - Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ - Get-Process | Where-Object PriorityClass -EQ Normal - ``` + `Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ` + + `Get-Process | Where-Object PriorityClass -EQ Normal` As shown in the example, the parameter names **Property** and **Value** are optional. The **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter @@ -1190,4 +1187,4 @@ You can read more about these methods here [about_Arrays](./About/about_Arrays.m [Tee-Object](../Microsoft.PowerShell.Utility/Tee-Object.md) -[about_Booleans](about/about_Booleans.md) +[about_Booleans](./About/about_Booleans.md) diff --git a/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md index 2b85e187682a..0c915a1b58cc 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md @@ -52,10 +52,7 @@ command. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - - ```powershell - Get-Process | ForEach-Object {$_.ProcessName} - ``` + `Get-Process | ForEach-Object {$_.ProcessName}` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -66,14 +63,12 @@ command. - **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - the pipeline. + pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - ```powershell - Get-Process | ForEach-Object ProcessName - ``` + `Get-Process | ForEach-Object ProcessName` The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see [about_Simplified_Syntax](About/about_Simplified_Syntax.md). @@ -117,8 +112,9 @@ This example takes an array of three integers and divides each one of them by 10 This example processes the files and directories in the PowerShell installation directory `$PSHOME`. ```powershell -Get-ChildItem $PSHOME | - ForEach-Object -Process {if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " }} +Get-ChildItem $PSHOME | ForEach-Object -Process { + if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " } +} ``` If the object isn't a directory, the script block gets the name of the file, divides the value of diff --git a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md index 55c83669668d..df7f85dcfee0 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md @@ -255,9 +255,7 @@ command. For example, the following command gets processes where the value of the **PriorityClass** property equals `Normal`. - ```powershell - Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} - ``` + `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). @@ -271,10 +269,9 @@ command. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - ```powershell - Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ - Get-Process | Where-Object PriorityClass -EQ Normal - ``` + `Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ` + + `Get-Process | Where-Object PriorityClass -EQ Normal` As shown in the example, the parameter names **Property** and **Value** are optional. The **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter diff --git a/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md index b07e04ca2342..a338df6ec839 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md @@ -52,10 +52,7 @@ command. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - - ```powershell - Get-Process | ForEach-Object {$_.ProcessName} - ``` + `Get-Process | ForEach-Object {$_.ProcessName}` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -66,14 +63,12 @@ command. - **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - the pipeline. + pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - ```powershell - Get-Process | ForEach-Object ProcessName - ``` + `Get-Process | ForEach-Object ProcessName` The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see [about_Simplified_Syntax](About/about_Simplified_Syntax.md). @@ -117,8 +112,9 @@ This example takes an array of three integers and divides each one of them by 10 This example processes the files and directories in the PowerShell installation directory `$PSHOME`. ```powershell -Get-ChildItem $PSHOME | - ForEach-Object -Process {if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " }} +Get-ChildItem $PSHOME | ForEach-Object -Process { + if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " } +} ``` If the object isn't a directory, the script block gets the name of the file, divides the value of diff --git a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md index 41756e7b385f..a271e0125e0d 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md @@ -255,9 +255,7 @@ command. For example, the following command gets processes where the value of the **PriorityClass** property equals `Normal`. - ```powershell - Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} - ``` + `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). @@ -271,10 +269,9 @@ command. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - ```powershell - Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ - Get-Process | Where-Object PriorityClass -EQ Normal - ``` + `Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ` + + `Get-Process | Where-Object PriorityClass -EQ Normal` As shown in the example, the parameter names **Property** and **Value** are optional. The **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter diff --git a/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md index a42986953164..6840aab1f116 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md @@ -52,10 +52,7 @@ command. For example, the following command gets the value of the **ProcessName** property of each process on the computer. - - ```powershell - Get-Process | ForEach-Object {$_.ProcessName} - ``` + `Get-Process | ForEach-Object {$_.ProcessName}` `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in [about_Functions](about/about_functions.md#piping-objects-to-functions). @@ -66,14 +63,12 @@ command. - **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - the pipeline. + pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. - ```powershell - Get-Process | ForEach-Object ProcessName - ``` + `Get-Process | ForEach-Object ProcessName` The simplified syntax was introduced in Windows PowerShell 3.0. For more information, see [about_Simplified_Syntax](About/about_Simplified_Syntax.md). @@ -117,8 +112,9 @@ This example takes an array of three integers and divides each one of them by 10 This example processes the files and directories in the PowerShell installation directory `$PSHOME`. ```powershell -Get-ChildItem $PSHOME | - ForEach-Object -Process {if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " }} +Get-ChildItem $PSHOME | ForEach-Object -Process { + if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " } +} ``` If the object isn't a directory, the script block gets the name of the file, divides the value of diff --git a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md index 37276a5eff3c..02da8a178834 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md @@ -255,9 +255,7 @@ command. For example, the following command gets processes where the value of the **PriorityClass** property equals `Normal`. - ```powershell - Get-Process | Where-Object {$_.PriorityClass -eq "Normal"} - ``` + `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}` All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). @@ -271,10 +269,9 @@ command. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. - ```powershell - Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ - Get-Process | Where-Object PriorityClass -EQ Normal - ``` + `Get-Process | Where-Object -Property PriorityClass -Value Normal -EQ` + + `Get-Process | Where-Object PriorityClass -EQ Normal` As shown in the example, the parameter names **Property** and **Value** are optional. The **Property** parameter is a positional parameter mapped to position `0`. The **Value** parameter From 1c75412a79c47bcb64930bcd2ad38331f45ca9e9 Mon Sep 17 00:00:00 2001 From: "Mikey Lombardi (He/Him)" Date: Thu, 24 Apr 2025 09:09:25 -0500 Subject: [PATCH 3/3] Apply suggestions from review --- reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md | 6 +++--- reference/5.1/Microsoft.PowerShell.Core/Where-Object.md | 6 +++--- reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md | 6 +++--- reference/7.4/Microsoft.PowerShell.Core/Where-Object.md | 6 +++--- reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md | 6 +++--- reference/7.5/Microsoft.PowerShell.Core/Where-Object.md | 6 +++--- reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md | 6 +++--- reference/7.6/Microsoft.PowerShell.Core/Where-Object.md | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md index 351d2fa53796..5382c04d609a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md @@ -52,9 +52,9 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in - the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - pipeline. +- **Simplified syntax**. Using the simplified syntax, you specify a property or method name of the + object in the pipeline. `ForEach-Object` returns the value of the property or method for each + object in the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index 11608415354b..bc02ad8a736a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -253,11 +253,11 @@ command. All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 switch parameters that represent the comparison operators. The simplified syntax is easier to read and write than the script block syntax. You can combine one of the switch parameters with the - **Property** and **Value** parameters to create a command that filters objects based on the values of - their properties. + **Property** and **Value** parameters to create a command that filters objects based on the + values of their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. diff --git a/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md index 0c915a1b58cc..6bce11d0ce56 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/ForEach-Object.md @@ -61,9 +61,9 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in - the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - pipeline. +- **Simplified syntax**. Using the simplified syntax, you specify a property or method name of the + object in the pipeline. `ForEach-Object` returns the value of the property or method for each + object in the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. diff --git a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md index df7f85dcfee0..c8ec9da98b2a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md @@ -260,11 +260,11 @@ command. All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 switch parameters that represent the comparison operators. The simplified syntax is easier to read and write than the script block syntax. You can combine one of the switch parameters with the - **Property** and **Value** parameters to create a command that filters objects based on the values of - their properties. + **Property** and **Value** parameters to create a command that filters objects based on the + values of their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. diff --git a/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md index a338df6ec839..a1f22f73ff90 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/ForEach-Object.md @@ -61,9 +61,9 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in - the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - pipeline. +- **Simplified syntax**. Using the simplified syntax, you specify a property or method name of the + object in the pipeline. `ForEach-Object` returns the value of the property or method for each + object in the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. diff --git a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md index a271e0125e0d..80154c9422fa 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md @@ -260,11 +260,11 @@ command. All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 switch parameters that represent the comparison operators. The simplified syntax is easier to read and write than the script block syntax. You can combine one of the switch parameters with the - **Property** and **Value** parameters to create a command that filters objects based on the values of - their properties. + **Property** and **Value** parameters to create a command that filters objects based on the + values of their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably. diff --git a/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md b/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md index 6840aab1f116..31718d347c8e 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/ForEach-Object.md @@ -61,9 +61,9 @@ command. > The script blocks run in the caller's scope. Therefore, the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes. -- **Simplified syntax**. Using the simplified syntax, you a property or method name of the object in - the pipeline. `ForEach-Object` returns the value of the property or method for each object in the - pipeline. +- **Simplified syntax**. Using the simplified syntax, you specify a property or method name of the + object in the pipeline. `ForEach-Object` returns the value of the property or method for each + object in the pipeline. For example, the following command also gets the value of the **ProcessName** property of each process on the computer. diff --git a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md index 02da8a178834..11d8c05558a6 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md @@ -260,11 +260,11 @@ command. All PowerShell comparison operators are valid in the script block format. For more information, see [about_Comparison_Operators](./About/about_Comparison_Operators.md). -- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 swicth +- **Simplified syntax**. To enable the simiplified syntax, `Where-Object` includes 31 switch parameters that represent the comparison operators. The simplified syntax is easier to read and write than the script block syntax. You can combine one of the switch parameters with the - **Property** and **Value** parameters to create a command that filters objects based on the values of - their properties. + **Property** and **Value** parameters to create a command that filters objects based on the + values of their properties. For example, the following commands also get processes that have a priority class of `Normal`. These commands are equivalent and you can use them interchangeably.