Skip to content

Commit 5cd680e

Browse files
Fix incorrect case/capitalization in ref docs
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 683ebdf commit 5cd680e

40 files changed

+460
-460
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ foreach ($file in Get-ChildItem)
8181
```
8282

8383
In this example, the `foreach` loop uses a property of the `$file` variable to
84-
perform a comparison operation (`$file.length -gt 100KB`). The `$file` variable
84+
perform a comparison operation (`$file.Length -gt 100KB`). The `$file` variable
8585
has all the properties of the object returned by the `Get-ChildItem`.
8686

8787
In the next example, the script displays the length and the last access time

reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ digital signature. For more information, see
431431

432432
The following sample creates a `Format-Table` custom view for the
433433
**System.IO.DirectoryInfo** and **System.IO.FileInfo** objects created by
434-
`Get-ChildItem`. The custom view is named **mygciview** and adds the
434+
`Get-ChildItem`. The custom view is named **MyGciView** and adds the
435435
**CreationTime** column to the table.
436436

437437
The custom view is created from an edited version of the
@@ -500,7 +500,7 @@ Update-FormatData -PrependPath $PSHOME\Format\MyFileSystem.Format.ps1xml
500500
</Controls>
501501
<ViewDefinitions>
502502
<View>
503-
<Name>mygciview</Name>
503+
<Name>MyGciView</Name>
504504
<ViewSelectedBy>
505505
<SelectionSetName>FileSystemTypes</SelectionSetName>
506506
</ViewSelectedBy>
@@ -541,14 +541,14 @@ Update-FormatData -PrependPath $PSHOME\Format\MyFileSystem.Format.ps1xml
541541
</TableColumnItem>
542542
<TableColumnItem>
543543
<ScriptBlock>
544-
[String]::Format("{0,10} {1,8}",
544+
[string]::Format("{0,10} {1,8}",
545545
$_.LastWriteTime.ToString("d"),
546546
$_.LastWriteTime.ToString("t"))
547547
</ScriptBlock>
548548
</TableColumnItem>
549549
<TableColumnItem>
550550
<ScriptBlock>
551-
[String]::Format("{0,10} {1,8}",
551+
[string]::Format("{0,10} {1,8}",
552552
$_.CreationTime.ToString("d"),
553553
$_.LastWriteTime.ToString("t"))
554554
</ScriptBlock>

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,21 @@ You can retrieve a function's definition by accessing the **Definition**
101101
property, as shown below.
102102

103103
```powershell
104-
(Get-Item -Path function:more).Definition
104+
(Get-Item -Path Function:more).Definition
105105
```
106106

107107
You can also retrieve a function's definition using its provider path prefixed
108108
by the dollar sign (`$`).
109109

110110
```powershell
111-
$function:more
111+
$Function:more
112112
```
113113

114114
To retrieve the definition for a function that has a dash (`-`) in the name,
115115
wrap the value after the dollar sign in curly braces.
116116

117117
```powershell
118-
${function:Clear-Host}
118+
${Function:Clear-Host}
119119
```
120120

121121
### Getting selected functions
@@ -132,7 +132,7 @@ Get-Item -Path man | Format-Table -Wrap -AutoSize
132132

133133
### Working with Function provider paths
134134

135-
These commands both get the function named `c:`. The first command can be used
135+
These commands both get the function named `C:`. The first command can be used
136136
in any drive. The second command is used in the `Function:` drive. Because the
137137
name ends in a colon, which is the syntax for a drive, you must qualify the
138138
path with the drive name. Within the `Function:` drive, you can use either
@@ -160,7 +160,7 @@ function, it is available only in the scope in which it was created. To make a
160160
function available, use a scope modifier when you create the function. For more
161161
information, see [about_Scopes][15].
162162

163-
The following example uses the `global:` scope modifier to create a function in
163+
The following example uses the `Global:` scope modifier to create a function in
164164
the global scope.
165165

166166
```powershell
@@ -170,14 +170,14 @@ function New-Function {
170170
[scriptblock] $Script
171171
)
172172
173-
$lp = "Function:\global:$($name)"
174-
Set-Item -LiteralPath $lp -Value $script -PassThru -Force
173+
$lp = "Function:\Global:$($Name)"
174+
Set-Item -LiteralPath $lp -Value $Script -PassThru -Force
175175
}
176176
177177
New-Function -Name 'Win32:' -Script { Set-Location C:\Windows\System32 }
178178
```
179179

180-
Without the `global:` scope modifier, the function would be created in the
180+
Without the `Global:` scope modifier, the function would be created in the
181181
local scope. When `New-Function` exits the newly created function would no
182182
longer exist.
183183

@@ -269,7 +269,7 @@ Get-Help Get-ChildItem
269269
```
270270

271271
```powershell
272-
Get-Help Get-ChildItem -Path function:
272+
Get-Help Get-ChildItem -Path Function:
273273
```
274274

275275
## See also

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ run as if you had typed them at the command prompt.
2222
Functions can be as simple as:
2323

2424
```powershell
25-
function Get-PowerShellProcess { Get-Process PowerShell }
25+
function Get-PowerShellProcess { Get-Process powershell }
2626
```
2727

2828
Once a function is defined, you can use it like the built-in cmdlets. For
@@ -71,7 +71,7 @@ like a cmdlet without using `C#` programming. For more information, see
7171
The following are the syntax for a function:
7272

7373
```Syntax
74-
function [<scope:>]<name> [([type]$parameter1[,[type]$parameter2])]
74+
function [<scope:>]<name> [([type]$Parameter1[,[type]$Parameter2])]
7575
{
7676
begin {<statement list>}
7777
process {<statement list>}
@@ -82,7 +82,7 @@ function [<scope:>]<name> [([type]$parameter1[,[type]$parameter2])]
8282
```Syntax
8383
function [<scope:>]<name>
8484
{
85-
param([type]$parameter1 [,[type]$parameter2])
85+
param([type]$Parameter1 [,[type]$Parameter2])
8686
dynamicparam {<statement list>}
8787
begin {<statement list>}
8888
process {<statement list>}
@@ -120,7 +120,7 @@ processing, and an `end` block for one-time post-processing.
120120
Function Test-ScriptCmdlet
121121
{
122122
[CmdletBinding(SupportsShouldProcess=$true)]
123-
Param ($Parameter1)
123+
param ($Parameter1)
124124
begin{}
125125
process{}
126126
end{}
@@ -188,11 +188,11 @@ For example, the following function finds all `.jpg` files in the current
188188
user's directories that were changed after the start date.
189189

190190
```powershell
191-
function Get-NewPix
191+
function Get-NewPicture
192192
{
193193
$start = Get-Date -Month 1 -Day 1 -Year 2010
194-
$allpix = Get-ChildItem -Path $env:UserProfile\*.jpg -Recurse
195-
$allpix | Where-Object {$_.LastWriteTime -gt $Start}
194+
$allPics = Get-ChildItem -Path $Env:USERPROFILE\*.jpg -Recurse
195+
$allPics | Where-Object {$_.LastWriteTime -gt $Start}
196196
}
197197
```
198198

@@ -234,25 +234,25 @@ in the following sample syntax:
234234

235235
```Syntax
236236
function <name> {
237-
param ([type]$parameter1 [,[type]$parameter2])
237+
param ([type]$Parameter1 [,[type]$Parameter2])
238238
<statement list>
239239
}
240240
```
241241

242-
You can also define parameters outside the braces without the `Param` keyword,
242+
You can also define parameters outside the braces without the `param` keyword,
243243
as shown in the following sample syntax:
244244

245245
```Syntax
246-
function <name> [([type]$parameter1[,[type]$parameter2])] {
246+
function <name> [([type]$Parameter1[,[type]$Parameter2])] {
247247
<statement list>
248248
}
249249
```
250250

251251
Below is an example of this alternative syntax.
252252

253253
```powershell
254-
function Add-Numbers([int]$one, [int]$two) {
255-
$one + $two
254+
function Add-Numbers([int]$One, [int]$Two) {
255+
$One + $Two
256256
}
257257
```
258258

@@ -269,7 +269,7 @@ the value of the `$Size` parameter, and it excludes directories:
269269

270270
```powershell
271271
function Get-SmallFiles {
272-
Param($Size)
272+
param ($Size)
273273
Get-ChildItem $HOME | Where-Object {
274274
$_.Length -lt $Size -and !$_.PSIsContainer
275275
}
@@ -369,8 +369,8 @@ name, as shown in the following example:
369369

370370
```powershell
371371
function Switch-Item {
372-
param ([switch]$on)
373-
if ($on) { "Switch on" }
372+
param ([switch]$On)
373+
if ($On) { "Switch on" }
374374
else { "Switch off" }
375375
}
376376
```
@@ -379,7 +379,7 @@ When you type the `On` switch parameter after the function name, the function
379379
displays `Switch on`. Without the switch parameter, it displays `Switch off`.
380380

381381
```powershell
382-
Switch-Item -on
382+
Switch-Item -On
383383
```
384384

385385
```Output
@@ -398,15 +398,15 @@ You can also assign a **Boolean** value to a switch when you run the function,
398398
as shown in the following example:
399399

400400
```powershell
401-
Switch-Item -on:$true
401+
Switch-Item -On:$true
402402
```
403403

404404
```Output
405405
Switch on
406406
```
407407

408408
```powershell
409-
Switch-Item -on:$false
409+
Switch-Item -On:$false
410410
```
411411

412412
```Output
@@ -607,7 +607,7 @@ You can specify the scope of a function. For example, the function is added to
607607
the global scope in the following example:
608608

609609
```powershell
610-
function global:Get-DependentSvs {
610+
function Global:Get-DependentSvs {
611611
Get-Service | Where-Object {$_.DependentServices}
612612
}
613613
```
@@ -633,21 +633,21 @@ The following command displays all the functions in the current session of
633633
PowerShell:
634634

635635
```powershell
636-
Get-ChildItem function:
636+
Get-ChildItem Function:
637637
```
638638

639639
The commands in the function are stored as a script block in the definition
640640
property of the function. For example, to display the commands in the Help
641641
function that comes with PowerShell, type:
642642

643643
```powershell
644-
(Get-ChildItem function:help).Definition
644+
(Get-ChildItem Function:help).Definition
645645
```
646646

647647
You can also use the following syntax.
648648

649649
```powershell
650-
$function:help
650+
$Function:help
651651
```
652652

653653
For more information about the `Function:` drive, see the help topic for the

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function.
137137
This method is called to request confirmation from the user before the function
138138
performs an action that would change the system. The function can continue
139139
based on the Boolean value returned by the method. This method can only be
140-
called only from within the `Process{}` block of the function. The
140+
called only from within the `process {}` block of the function. The
141141
`CmdletBinding` attribute must also declare that the function supports
142142
`ShouldProcess` (as shown in the previous example).
143143

@@ -160,7 +160,7 @@ Functions can call two different methods when errors occur. When a
160160
non-terminating error occurs, the function should call the `WriteError` method,
161161
which is described in the `Write` methods section. When a terminating error
162162
occurs and the function can't continue, it should call the
163-
`ThrowTerminatingError` method. You can also use the `Throw` statement for
163+
`ThrowTerminatingError` method. You can also use the `throw` statement for
164164
terminating errors and the [Write-Error][22] cmdlet for non-terminating errors.
165165

166166
For more information, see

0 commit comments

Comments
 (0)