@@ -12,21 +12,20 @@ Describes the operators that are supported by PowerShell.
1212
1313## Long description
1414
15- An operator is a language element that you can use in a command or
16- expression. PowerShell supports several types of operators to help you
17- manipulate values.
15+ An operator is a language element that you can use in a command or expression.
16+ PowerShell supports several types of operators to help you manipulate values.
1817
1918### Arithmetic Operators
2019
2120Use arithmetic operators (` + ` , ` - ` , ` * ` , ` / ` , ` % ` ) to calculate values in a
22- command or expression. With these operators, you can add, subtract,
23- multiply, or divide values, and calculate the remainder (modulus) of a
24- division operation.
21+ command or expression. With these operators, you can add, subtract, multiply,
22+ or divide values, and calculate the remainder (modulus) of a division
23+ operation.
2524
2625The addition operator concatenates elements. The multiplication operator
27- returns the specified number of copies of each element. You can use
28- arithmetic operators on any .NET type that implements them, such as: ` Int ` ,
29- ` String ` , ` DateTime ` , ` Hashtable ` , and Arrays.
26+ returns the specified number of copies of each element. You can use arithmetic
27+ operators on any .NET type that implements them, such as: ` Int ` , ` String ` ,
28+ ` DateTime ` , ` Hashtable ` , and Arrays.
3029
3130For more information, see [ about_Arithmetic_Operators] ( about_Arithmetic_Operators.md ) .
3231
@@ -40,9 +39,9 @@ For more information, see [about_Assignment_Operators](about_Assignment_Operator
4039
4140### Comparison Operators
4241
43- Use comparison operators (` -eq ` , ` -ne ` , ` -gt ` , ` -lt ` , ` -le ` , ` -ge ` ) to
44- compare values and test conditions. For example, you can compare two string
45- values to determine whether they are equal.
42+ Use comparison operators (` -eq ` , ` -ne ` , ` -gt ` , ` -lt ` , ` -le ` , ` -ge ` ) to compare
43+ values and test conditions. For example, you can compare two string values to
44+ determine whether they are equal.
4645
4746The comparison operators also include operators that find or replace patterns
4847in text. The (` -match ` , ` -notmatch ` , ` -replace ` ) operators use regular
@@ -51,17 +50,17 @@ expressions, and (`-like`, `-notlike`) use wildcards `*`.
5150Containment comparison operators determine whether a test value appears in a
5251reference set (` -in ` , ` -notin ` , ` -contains ` , ` -notcontains ` ).
5352
54- Bitwise comparison operators (` -bAND ` , ` -bOR ` , ` -bXOR ` , ` -bNOT ` ) manipulate
55- the bit patterns in values.
53+ Bitwise comparison operators (` -bAND ` , ` -bOR ` , ` -bXOR ` , ` -bNOT ` ) manipulate the
54+ bit patterns in values.
5655
5756For more information, see [ about_Comparison_Operators] ( about_Comparison_Operators.md ) .
5857
5958### Logical Operators
6059
6160Use logical operators (` -and ` , ` -or ` , ` -xor ` , ` -not ` , ` ! ` ) to connect
62- conditional statements into a single complex conditional. For example, you
63- can use a logical ` -and ` operator to create an object filter with two
64- different conditions.
61+ conditional statements into a single complex conditional. For example, you can
62+ use a logical ` -and ` operator to create an object filter with two different
63+ conditions.
6564
6665For more information, see [ about_Logical_Operators] ( about_logical_operators.md ) .
6766
@@ -77,9 +76,9 @@ For more information, see [about_Redirection](about_Redirection.md)
7776
7877### Split and Join Operators
7978
80- The ` -split ` and ` -join ` operators divide and combine substrings. The
81- ` -split ` operator splits a string into substrings. The ` -join ` operator
82- concatenates multiple strings into a single string.
79+ The ` -split ` and ` -join ` operators divide and combine substrings. The ` -split `
80+ operator splits a string into substrings. The ` -join ` operator concatenates
81+ multiple strings into a single string.
8382
8483For more information, see [ about_Split] ( about_Split.md ) and
8584[ about_Join] ( about_Join.md ) .
@@ -93,15 +92,15 @@ For more information, see [about_Type_Operators](about_Type_Operators.md).
9392
9493### Unary Operators
9594
96- Use unary operators to increment or decrement variables or object
97- properties and to set integers to positive or negative numbers. For
98- example, to increment the variable ` $a ` from ` 9 ` to ` 10 ` , you type ` $a++ ` .
95+ Use unary operators to increment or decrement variables or object properties
96+ and to set integers to positive or negative numbers. For example, to increment
97+ the variable ` $a ` from ` 9 ` to ` 10 ` , you type ` $a++ ` .
9998
10099### Special Operators
101100
102101Special operators have specific use-cases that do not fit into any other
103- operator group. For example, special operators allow you to
104- run commands, change a value's data type, or retrieve elements from an array.
102+ operator group. For example, special operators allow you to run commands,
103+ change a value's data type, or retrieve elements from an array.
105104
106105#### Array subexpression operator ` @( ) `
107106
@@ -261,8 +260,8 @@ $job = Start-Job -ScriptBlock {Get-Process -Name pwsh}
261260Receive-Job $job -Wait
262261```
263262
264- If you want to run multiple commands, each in their own background process
265- but all on one line, simply place ` & ` between and after each of the commands.
263+ If you want to run multiple commands, each in their own background process but
264+ all on one line, simply place ` & ` between and after each of the commands.
266265
267266For more information on PowerShell jobs, see [ about_Jobs] ( about_Jobs.md ) .
268267
@@ -300,18 +299,18 @@ variables that the script creates are added to the current scope.
300299> distinguish the dot from the dot (` . ` ) symbol that represents the current
301300> directory.
302301
303- In the following example, the Sample.ps1 script in the current directory is
304- run in the current scope.
302+ In the following example, the Sample.ps1 script in the current directory is run
303+ in the current scope.
305304
306305``` powershell
307306. .\sample.ps1
308307```
309308
310309#### Format operator ` -f `
311310
312- Formats strings by using the format method of string objects. Enter the
313- format string on the left side of the operator and the objects to be
314- formatted on the right side of the operator.
311+ Formats strings by using the format method of string objects. Enter the format
312+ string on the left side of the operator and the objects to be formatted on the
313+ right side of the operator.
315314
316315``` powershell
317316"{0} {1,-10} {2:N}" -f 1,"hello",[math]::pi
@@ -326,10 +325,10 @@ method and [Composite Formatting](/dotnet/standard/base-types/composite-formatti
326325
327326#### Index operator ` [ ] `
328327
329- Selects objects from indexed collections, such as arrays and hash tables.
330- Array indexes are zero-based, so the first object is indexed as ` [0] ` . For
331- arrays (only), you can also use negative indexes to get the last values.
332- Hash tables are indexed by key value.
328+ Selects objects from indexed collections, such as arrays and hash tables. Array
329+ indexes are zero-based, so the first object is indexed as ` [0] ` . For arrays
330+ (only), you can also use negative indexes to get the last values. Hash tables
331+ are indexed by key value.
333332
334333```
335334PS> $a = 1, 2, 3
@@ -365,9 +364,9 @@ Once upon a time...
365364
366365#### Pipeline operator ` | `
367366
368- Sends ("pipes") the output of the command that precedes it to the command
369- that follows it. When the output includes more than one object (a
370- "collection"), the pipeline operator sends the objects one at a time.
367+ Sends ("pipes") the output of the command that precedes it to the command that
368+ follows it. When the output includes more than one object (a "collection"), the
369+ pipeline operator sends the objects one at a time.
371370
372371``` powershell
373372Get-Process | Get-Member
@@ -376,8 +375,12 @@ Get-PSSnapin | Where-Object {$_.vendor -ne "Microsoft"}
376375
377376#### Pipeline chain operators ` && ` and ` || `
378377
379- Conditionally execute the right-hand side pipeline
380- based on the success of the left-hand side pipeline.
378+ > [ !NOTE]
379+ > This is an experimental feature. For more information see
380+ > [ about_Experimental_Features] ( about_Experimental_Features.md ) .
381+
382+ Conditionally execute the right-hand side pipeline based on the success of the
383+ left-hand side pipeline.
381384
382385``` powershell
383386# If Get-Process successfully finds a process called notepad,
0 commit comments