Skip to content

Commit e9a3f92

Browse files
Fix incorrect case/capitalization in ref docs (#11918)
This ensures the following components have the correct/consistent case throughout the reference documentation: Preference variable, PS environment variable, PS drive, PS provider, PS command name, PS command argument, PS module, PS file extension, PS host name/application, #Requires statement, parameter name, about_* topic, member name, scope modifier, keyword, operator, calculated property key/value, attribute, type accelerator, type literal/name, WMI namespace/class, variable name, special character, comment-based help keyword, product/company name, Windows drive letter/directory, Windows/Unix environment variable In addition, changes include fixes to incorrect terminology (e.g., referring to a keyword as a command) and formatting of PS syntax elements (non-exhaustive).
1 parent 201d6fc commit e9a3f92

40 files changed

+197
-197
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ a certificate file in the file system directory.
204204
At the PowerShell prompt, type:
205205

206206
```powershell
207-
Get-ChildItem cert:\CurrentUser\my -CodeSigning
207+
Get-ChildItem Cert:\CurrentUser\my -CodeSigning
208208
```
209209

210210
This command uses the PowerShell Certificate provider to view information
@@ -241,7 +241,7 @@ To use this script, copy the following text into a text file, and name it
241241

242242
```powershell
243243
## Signs a file
244-
[cmdletbinding()]
244+
[CmdletBinding()]
245245
param(
246246
[Parameter(Mandatory=$true)]
247247
[string] $File
@@ -260,7 +260,7 @@ PowerShell command prompt:
260260
$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert |
261261
Select-Object -First 1
262262
263-
Set-AuthenticodeSignature add-signature.ps1 $cert
263+
Set-AuthenticodeSignature Add-Signature.ps1 $cert
264264
```
265265

266266
The `Set-AuthenticodeSignature` cmdlet adds the signature to the script file as

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ omit them from the command. Using aliases, you can further simplify the
6060
commands:
6161

6262
```powershell
63-
dir Cert:\LocalMachine\Root | Where FriendlyName -EQ 'Verisign'
63+
dir Cert:\LocalMachine\Root | where FriendlyName -EQ 'Verisign'
6464
dir Cert:\ -Recurse | foreach GetKeyAlgorithm
6565
```
6666

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ There is a vertical tab
174174
between the words.
175175
```
176176

177-
On printers or in a unix-based consoles, the vertical tab character advances to
177+
On printers or in a Unix-based console, the vertical tab character advances to
178178
the next line and writes the remaining output at that point.
179179

180180
```Output

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ an array of strings.
129129
```powershell
130130
$array = 'Hello', 'World!'
131131
Invoke-Command -ScriptBlock {
132-
param([string[]]$words) $words -join ' '
132+
param([string[]]$Words) $Words -join ' '
133133
} -ArgumentList $array
134134
```
135135

@@ -142,7 +142,7 @@ Hello
142142
```powershell
143143
$array = 'Hello', 'World!'
144144
Invoke-Command -ScriptBlock {
145-
param([string[]]$words) $words -join ' '
145+
param([string[]]$Words) $Words -join ' '
146146
} -ArgumentList (,$array)
147147
```
148148

@@ -276,7 +276,7 @@ When you use the `Get-MyProcess` function, all unassigned parameters and
276276
parameter values are passed to `@args`, as shown in the following commands.
277277

278278
```powershell
279-
Get-MyProcess -Name PowerShell
279+
Get-MyProcess -Name powershell
280280
```
281281

282282
```Output
@@ -286,7 +286,7 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
286286
```
287287

288288
```powershell
289-
Get-MyProcess -Name PowerShell_Ise -FileVersionInfo
289+
Get-MyProcess -Name powershell_ise -FileVersionInfo
290290
```
291291

292292
```Output
@@ -302,12 +302,12 @@ passed to all instances of `@args`, as shown in the following example.
302302
```powershell
303303
function Get-MyCommand
304304
{
305-
Param ([switch]$P, [switch]$C)
305+
param ([switch]$P, [switch]$C)
306306
if ($P) { Get-Process @args }
307307
if ($C) { Get-Command @args }
308308
}
309309
310-
Get-MyCommand -P -C -Name PowerShell
310+
Get-MyCommand -P -C -Name powershell
311311
```
312312

313313
```Output

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ The parameter names do not appear in the command. Include only the parameter
3636
values. The values must appear in the order specified in the syntax diagram.
3737

3838
```
39-
-Split <String>
40-
-Split (<String[]>)
41-
<String> -Split <Delimiter>[,<Max-substrings>[,"<Options>"]]
42-
<String> -Split {<ScriptBlock>} [,<Max-substrings>]
39+
-split <String>
40+
-split (<String[]>)
41+
<String> -split <Delimiter>[,<Max-substrings>[,"<Options>"]]
42+
<String> -split {<ScriptBlock>} [,<Max-substrings>]
4343
```
4444

45-
You can substitute `-iSplit` or `-cSplit` for `-split` in any binary Split
45+
You can substitute `-isplit` or `-csplit` for `-split` in any binary Split
4646
statement (a Split statement that includes a delimiter or script block). The
47-
`-iSplit` and `-split` operators are case-insensitive. The `-cSplit` operator
47+
`-isplit` and `-split` operators are case-insensitive. The `-csplit` operator
4848
is case-sensitive, meaning that case is considered when the delimiter rules
4949
are applied.
5050

@@ -223,15 +223,15 @@ The SimpleMatch options are:
223223

224224
- **SimpleMatch**: Use simple string comparison when evaluating the
225225
delimiter. Cannot be used with RegexMatch.
226-
- **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit
226+
- **IgnoreCase**: Forces case-insensitive matching, even if the -csplit
227227
operator is specified.
228228

229229
The RegexMatch options are:
230230

231231
- **RegexMatch**: Use regular expression matching to evaluate the
232232
delimiter. This is the default behavior. Cannot be used with
233233
SimpleMatch.
234-
- **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit
234+
- **IgnoreCase**: Forces case-insensitive matching, even if the -csplit
235235
operator is specified.
236236
- **CultureInvariant**: Ignores cultural differences in language when
237237
evaluating the delimiter. Valid only with RegexMatch.
@@ -343,7 +343,7 @@ cury,Venus,Earth,Mars,Jupit
343343
The following statement performs a case-sensitive split at the letter "N".
344344

345345
```powershell
346-
"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N'
346+
"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -csplit 'N'
347347
```
348348

349349
```Output
@@ -441,7 +441,7 @@ $a = @'
441441
2The second line.
442442
3The third of three lines.
443443
'@
444-
$a -split "^\d", 0, "multiline"
444+
$a -split "^\d", 0, "Multiline"
445445
```
446446

447447
```Output
@@ -480,7 +480,7 @@ can use options, such as SimpleMatch, only when the Max-substrings value is
480480
specified.
481481

482482
```powershell
483-
"This.is.a.test" -split ".", 0, "simplematch"
483+
"This.is.a.test" -split ".", 0, "SimpleMatch"
484484
```
485485

486486
```Output

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ statement conditions.
342342

343343
```powershell
344344
switch ("Test") {
345-
{ $_ -is [String] } { "Found a string" }
345+
{ $_ -is [string] } { "Found a string" }
346346
"Test" { "This $_ executes as well" }
347347
}
348348
```
@@ -383,7 +383,7 @@ non-number is encountered, execution is terminated with the `break` keyword.
383383
```powershell
384384
switch (1,4,-1,3,"Hello",2,1) {
385385
{$_ -lt 0} { continue }
386-
{$_ -isnot [Int32]} { break }
386+
{$_ -isnot [int32]} { break }
387387
{$_ % 2} { "$_ is Odd" }
388388
{-not ($_ % 2)} { "$_ is Even" }
389389
}
@@ -445,7 +445,7 @@ switch -File $fileEscaped { foo { 'Foo' } }
445445

446446
## See also
447447

448-
- [about_break][03]
448+
- [about_Break][03]
449449
- [about_Continue][05]
450450
- [about_If][06]
451451
- [about_Script_Blocks][07]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.date: 06/13/2024
55
no-loc: [<kbd>Tab</kbd>, <kbd>Ctrl</kbd>, <kbd>Space</kbd>]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_tab_expansion?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
8-
title: About_tab_expansion
8+
title: about_Tab_Expansion
99
---
1010
# about_Tab_Expansion
1111

@@ -77,7 +77,7 @@ You can then partially specify the path to the Active Setup log file and use
7777
tab expansion again:
7878

7979
```powershell
80-
PS> Get-Content c:\windows\acts<Tab>
80+
PS> Get-Content C:\windows\acts<Tab>
8181
```
8282

8383
When you press the <kbd>Tab</kbd> key, the command expands to:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Describes the Throw keyword, which generates a terminating error.
2+
description: Describes the `throw` keyword, which generates a terminating error.
33
Locale: en-US
44
ms.date: 08/24/2022
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_throw?view=powershell-5.1&WT.mc_id=ps-gethelp
@@ -80,7 +80,7 @@ throw (Get-Process pwsh)
8080

8181
```Output
8282
At line:1 char:6
83-
+ throw <<<< (get-process PowerShell)
83+
+ throw <<<< (Get-Process powershell)
8484
+ CategoryInfo : OperationStopped: (System.Diagnostics.Process (Pow
8585
erShell):Process) [],
8686
RuntimeException

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ terminating errors.
1616
## Long description
1717

1818
Use `try`, `catch`, and `finally` blocks to respond to or handle terminating
19-
errors in scripts. The `Trap` statement can also be used to handle terminating
19+
errors in scripts. The `trap` statement can also be used to handle terminating
2020
errors in scripts. For more information, see [about_Trap][05].
2121

2222
A terminating error stops a statement from running. If PowerShell does not
@@ -29,8 +29,8 @@ PowerShell to monitor for errors. When an error occurs within the `try` block,
2929
the error is first saved to the `$Error` automatic variable. PowerShell then
3030
searches for a `catch` block to handle the error. If the `try` statement does
3131
not have a matching `catch` block, PowerShell continues to search for an
32-
appropriate `catch` block or `Trap` statement in the parent scopes. After a
33-
`catch` block is completed or if no appropriate `catch` block or `Trap`
32+
appropriate `catch` block or `trap` statement in the parent scopes. After a
33+
`catch` block is completed or if no appropriate `catch` block or `trap`
3434
statement is found, the `finally` block is run. If the error cannot be handled,
3535
the error is written to the error stream.
3636

@@ -134,7 +134,7 @@ two `catch` blocks:
134134
```powershell
135135
try {
136136
$wc = New-Object System.Net.WebClient
137-
$wc.DownloadFile("http://www.contoso.com/MyDoc.doc","c:\temp\MyDoc.doc")
137+
$wc.DownloadFile("http://www.contoso.com/MyDoc.doc","C:\temp\MyDoc.doc")
138138
} catch [System.Net.WebException],[System.IO.IOException] {
139139
"Unable to download MyDoc.doc from http://www.contoso.com."
140140
} catch {
@@ -179,12 +179,12 @@ block for the derived class before the `catch` block for the general class.
179179
180180
## Using Traps in a Try Catch
181181

182-
When a terminating error occurs in a `try` block with a `Trap` defined within
183-
the `try` block, even if there is a matching `catch` block, the `Trap`
182+
When a terminating error occurs in a `try` block with a `trap` defined within
183+
the `try` block, even if there is a matching `catch` block, the `trap`
184184
statement takes control.
185185

186-
If a `Trap` exists at a higher block than the `try`, and there is no matching
187-
`catch` block within the current scope, the `Trap` will take control, even if
186+
If a `trap` exists at a higher block than the `try`, and there is no matching
187+
`catch` block within the current scope, the `trap` will take control, even if
188188
any parent scope has a matching `catch` block.
189189

190190
## Accessing exception information
@@ -236,18 +236,18 @@ To free resources used by a script, add a `finally` block after the `try` and
236236
before the script terminates or before the current block goes out of scope.
237237

238238
A `finally` block runs even if you use <kbd>CTRL</kbd>+<kbd>C</kbd> to stop the
239-
script. A `finally` block also runs if an Exit keyword stops the script from
239+
script. A `finally` block also runs if an `exit` keyword stops the script from
240240
within a `catch` block.
241241

242242
In the following example, the `try` block attempts to download a file to the
243-
`c:\temp` folder. The `catch` blocks handle errors that occur during the
243+
`C:\temp` folder. The `catch` blocks handle errors that occur during the
244244
download. The `finally` block disposes of the `WebClient` object and removes
245245
the temporary file if it exists.
246246

247247
```powershell
248248
try {
249249
$wc = New-Object System.Net.WebClient
250-
$tempFile = "c:\temp\MyDoc.doc"
250+
$tempFile = "C:\temp\MyDoc.doc"
251251
$wc.DownloadFile("http://www.contoso.com/MyDoc.doc",$tempFile)
252252
} catch [System.Net.WebException],[System.IO.IOException] {
253253
"Unable to download MyDoc.doc from http://www.contoso.com."

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ PowerShell also assigns types to literal values automatically.
195195

196196
Numeric literals are implicitly typed by default. Numbers are typed based on
197197
their size. For example, `42` is small enough to be stored as an **Int32** type
198-
and `1.2` is stored as a **Double**. Integers larger than `[Int32]::MaxValue`
198+
and `1.2` is stored as a **Double**. Integers larger than `[int32]::MaxValue`
199199
are stored as **Int64**. While `42` can be stored as a **Byte** and `1.2` can
200200
be stored as a **Single** type, the implicit typing uses **Int32** and
201201
**Double** respectively. For more information, see
@@ -229,7 +229,7 @@ These contexts include:
229229
PowerShell attempts to convert values passed to parameters to match the
230230
parameter type. Type conversion of parameter values occurs in cmdlets,
231231
functions, scripts, scriptblocks, or .NET methods where the parameter is
232-
declared with a specific type. Declaring a parameter with the type `[object]`
232+
declared with a specific type. Declaring a parameter with the type `[Object]`
233233
or not defining a specific type allows any value type to be passed to a
234234
parameter. Parameters can also have custom conversions defined by decorating
235235
parameters with [ArgumentTransformationAttribute][17] attribute.
@@ -302,7 +302,7 @@ New-Object: Cannot find an overload for "Guid" and the argument count: "16".
302302
```
303303

304304
PowerShell treats the `$bytes` array as a list of individual parameters even
305-
though `$bytes` is an array of bytes and `System.Guid` has a `Guid(Byte[])`
305+
though `$bytes` is an array of bytes and `System.Guid` has a `Guid(byte[])`
306306
constructor.
307307

308308
This common code pattern is an instance of _pseudo method syntax_, which
@@ -314,7 +314,7 @@ PS> New-Object -TypeName System.Guid -ArgumentList $bytes
314314
New-Object: Cannot find an overload for "Guid" and the argument count: "16".
315315
```
316316

317-
Given that the type of **ArgumentList** is `[object[]]`, a single argument that
317+
Given that the type of **ArgumentList** is `[Object[]]`, a single argument that
318318
happens to be an array (of any type) binds to it _element by element_. The
319319
workaround is to wrap `$bytes` in an outer array so that PowerShell looks for a
320320
constructor with parameters that match the contents of the outer array.
@@ -329,8 +329,8 @@ Guid
329329
04030201-0605-0807-090a-0b0c0d0e0f10
330330
```
331331

332-
The first item of the wrapped array is our original `Byte[]` instance. That
333-
value matches the `Guid(Byte[]]` constructor.
332+
The first item of the wrapped array is our original `[byte[]]` instance. That
333+
value matches the `Guid(byte[])` constructor.
334334

335335
An alternative to the array wrapping workaround is to use the intrinsic static
336336
`new()` method.
@@ -402,7 +402,7 @@ If you want the result to be an **Int64**, you can cast the result type or
402402
operands.
403403

404404
```powershell
405-
PS> ([Int64]([int]::MaxValue + 1)).GetType().Name
405+
PS> ([int64]([int]::MaxValue + 1)).GetType().Name
406406
Int64
407407
```
408408

0 commit comments

Comments
 (0)