Skip to content

Commit c53d1b3

Browse files
authored
Fix more typos in ref article (#11594)
1 parent 0e39745 commit c53d1b3

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Describes how to create and use a reference type variable.
1717
You can pass variables to functions _by reference_ or _by value_. When you pass
1818
a variable _by value_, you are passing a copy of the data. When you pass a
1919
variable _by reference_, you are passing a reference to the original value.
20-
This allows the function to change the value of the variable that is passed to
21-
it.Reference types are created using `[ref]`, which is the type accelerator for
22-
the `[System.Management.Automation.PSReference]` type.
20+
This allows the function to change the value of the variable that's passed to
21+
it. Reference types are created using `[ref]`, which is the type accelerator
22+
for the `[System.Management.Automation.PSReference]` type.
2323

2424
The primary purpose of `[ref]` is to enable passing PowerShell variables by
2525
reference to .NET method parameters marked as `ref`, `out`, or `in`. You can
@@ -83,14 +83,14 @@ When using references, you must use the `Value` property of the `[ref]` type to
8383
access your data.
8484

8585
```powershell
86-
Function Test([ref]$data)
87-
{
86+
function Test {
87+
param([ref]$data)
8888
$data.Value = 3
8989
}
9090
```
9191

92-
To pass a variable to a parameter that expects a reference, you must type
93-
cast your variable as a reference.
92+
To pass a variable to a parameter that expects a reference, you must type cast
93+
your variable as a reference.
9494

9595
> [!IMPORTANT]
9696
> The brackets and parenthesis are BOTH required.
@@ -183,9 +183,9 @@ Get-ChildItem -File $setPath |
183183

184184
## Difference between `[ref]` and `[System.Management.Automation.PSReference]`
185185

186-
A reference type variable is created using
187-
188-
Even though `[ref]` is a type accelerator for
186+
A reference type variable is created using the `[ref]` type accelerator or by
187+
specifying the `[System.Management.Automation.PSReference]` type directly. Even
188+
though `[ref]` is a type accelerator for
189189
`[System.Management.Automation.PSReference]`, they behave differently.
190190

191191
- When you use `[ref]` to cast a variable, PowerShell creates a reference object

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Describes how to create and use a reference type variable.
1717
You can pass variables to functions _by reference_ or _by value_. When you pass
1818
a variable _by value_, you are passing a copy of the data. When you pass a
1919
variable _by reference_, you are passing a reference to the original value.
20-
This allows the function to change the value of the variable that is passed to
21-
it.Reference types are created using `[ref]`, which is the type accelerator for
22-
the `[System.Management.Automation.PSReference]` type.
20+
This allows the function to change the value of the variable that's passed to
21+
it. Reference types are created using `[ref]`, which is the type accelerator
22+
for the `[System.Management.Automation.PSReference]` type.
2323

2424
The primary purpose of `[ref]` is to enable passing PowerShell variables by
2525
reference to .NET method parameters marked as `ref`, `out`, or `in`. You can
@@ -83,14 +83,14 @@ When using references, you must use the `Value` property of the `[ref]` type to
8383
access your data.
8484

8585
```powershell
86-
Function Test([ref]$data)
87-
{
86+
function Test {
87+
param([ref]$data)
8888
$data.Value = 3
8989
}
9090
```
9191

92-
To pass a variable to a parameter that expects a reference, you must type
93-
cast your variable as a reference.
92+
To pass a variable to a parameter that expects a reference, you must type cast
93+
your variable as a reference.
9494

9595
> [!IMPORTANT]
9696
> The brackets and parenthesis are BOTH required.
@@ -183,9 +183,9 @@ Get-ChildItem -File $setPath |
183183

184184
## Difference between `[ref]` and `[System.Management.Automation.PSReference]`
185185

186-
A reference type variable is created using
187-
188-
Even though `[ref]` is a type accelerator for
186+
A reference type variable is created using the `[ref]` type accelerator or by
187+
specifying the `[System.Management.Automation.PSReference]` type directly. Even
188+
though `[ref]` is a type accelerator for
189189
`[System.Management.Automation.PSReference]`, they behave differently.
190190

191191
- When you use `[ref]` to cast a variable, PowerShell creates a reference object

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Describes how to create and use a reference type variable.
1717
You can pass variables to functions _by reference_ or _by value_. When you pass
1818
a variable _by value_, you are passing a copy of the data. When you pass a
1919
variable _by reference_, you are passing a reference to the original value.
20-
This allows the function to change the value of the variable that is passed to
21-
it.Reference types are created using `[ref]`, which is the type accelerator for
22-
the `[System.Management.Automation.PSReference]` type.
20+
This allows the function to change the value of the variable that's passed to
21+
it. Reference types are created using `[ref]`, which is the type accelerator
22+
for the `[System.Management.Automation.PSReference]` type.
2323

2424
The primary purpose of `[ref]` is to enable passing PowerShell variables by
2525
reference to .NET method parameters marked as `ref`, `out`, or `in`. You can
@@ -83,14 +83,14 @@ When using references, you must use the `Value` property of the `[ref]` type to
8383
access your data.
8484

8585
```powershell
86-
Function Test([ref]$data)
87-
{
86+
function Test {
87+
param([ref]$data)
8888
$data.Value = 3
8989
}
9090
```
9191

92-
To pass a variable to a parameter that expects a reference, you must type
93-
cast your variable as a reference.
92+
To pass a variable to a parameter that expects a reference, you must type cast
93+
your variable as a reference.
9494

9595
> [!IMPORTANT]
9696
> The brackets and parenthesis are BOTH required.
@@ -183,9 +183,9 @@ Get-ChildItem -File $setPath |
183183

184184
## Difference between `[ref]` and `[System.Management.Automation.PSReference]`
185185

186-
A reference type variable is created using
187-
188-
Even though `[ref]` is a type accelerator for
186+
A reference type variable is created using the `[ref]` type accelerator or by
187+
specifying the `[System.Management.Automation.PSReference]` type directly. Even
188+
though `[ref]` is a type accelerator for
189189
`[System.Management.Automation.PSReference]`, they behave differently.
190190

191191
- When you use `[ref]` to cast a variable, PowerShell creates a reference object

0 commit comments

Comments
 (0)