Skip to content

Commit d298e33

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 d298e33

40 files changed

+358
-358
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the user creates:
2727

2828
```powershell
2929
function PSConsoleHostReadLine {
30-
$inputFile = Join-Path $env:TEMP PSConsoleHostReadLine
30+
$inputFile = Join-Path $Env:TEMP PSConsoleHostReadLine
3131
Set-Content $inputFile "PS > "
3232
3333
# Notepad opens. Enter your command in it, save the file, and then exit.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ properties and values was more complicated. Originally, you had to use
2323
example:
2424

2525
```powershell
26-
PS> $object1 = New-Object -TypeName PSObject
26+
PS> $object1 = New-Object -TypeName psobject
2727
PS> Add-Member -InputObject $object1 -MemberType NoteProperty -Name one -Value 1
2828
PS> Add-Member -InputObject $object1 -MemberType NoteProperty -Name two -Value 2
2929
PS> $object1 | Get-Member
@@ -50,7 +50,7 @@ Later, you could use the **Property** parameter of `New-Object` to pass a
5050
**Hashtable** containing the members and values. For example:
5151

5252
```powershell
53-
PS> $object2 = New-Object -TypeName PSObject -Property @{one=1; two=2}
53+
PS> $object2 = New-Object -TypeName psobject -Property @{one=1; two=2}
5454
PS> $object2 | Get-Member
5555
5656
TypeName: System.Management.Automation.PSCustomObject
@@ -191,11 +191,11 @@ have subtle side effects.
191191
- Wrapped objects match their original type and the `[psobject]` type.
192192

193193
```powershell
194-
PS> 1 -is [Int32]
194+
PS> 1 -is [int32]
195195
True
196196
PS> 1 -is [psobject]
197197
False
198-
PS> ([psobject] 1) -is [Int32]
198+
PS> ([psobject] 1) -is [int32]
199199
True
200200
PS> ([psobject] 1) -is [psobject]
201201
True
@@ -248,7 +248,7 @@ When that hashtable is cast to a `[pscustomobject]`, the case of the name of
248248
first key is used, but that value of the last matching key name is used.
249249

250250
```powershell
251-
[PSCustomObject]$OrderedHashTable
251+
[pscustomobject]$OrderedHashTable
252252
```
253253

254254
```Output
@@ -266,7 +266,7 @@ Attempting to access these members returns `$null`.
266266
For example:
267267

268268
```powershell
269-
PS> $object = [PSCustomObject]@{key = 'value'}
269+
PS> $object = [pscustomobject]@{key = 'value'}
270270
PS> $object
271271
272272
key

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ parameters that take input from the pipeline.
189189
function Write-JsonLog {
190190
[CmdletBinding()]
191191
param(
192-
[parameter(ValueFromPipelineByPropertyName)]
192+
[Parameter(ValueFromPipelineByPropertyName)]
193193
[string]$Message
194194
)
195195
begin {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Variable expressions carry the value of the variable they reference:
5959

6060
```powershell
6161
$x
62-
$script:path
62+
$Script:path
6363
```
6464

6565
Operators combine other expressions for evaluation:
@@ -352,7 +352,7 @@ arguments to the executable. You can use this tool to verify that you have
352352
properly escaped the characters in your arguments.
353353

354354
```powershell
355-
TestExe -echoargs """""${env:ProgramFiles(x86)}\Microsoft\\"""""
355+
TestExe -echoargs """""${Env:ProgramFiles(x86)}\Microsoft\\"""""
356356
TestExe -echoargs """""C:\Program Files (x86)\Microsoft\\"""""
357357
TestExe -echoargs --% ""\""C:\Program Files (x86)\Microsoft\\""
358358
TestExe -echoargs --% """C:\Program Files (x86)\Microsoft\\""
@@ -390,7 +390,7 @@ Unlike the stop-parsing (`--%`) token, any values following the `--` token can
390390
be interpreted as expressions by PowerShell.
391391

392392
```powershell
393-
Write-Output -- -InputObject $env:PROCESSOR_ARCHITECTURE
393+
Write-Output -- -InputObject $Env:PROCESSOR_ARCHITECTURE
394394
```
395395

396396
```Output

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Get-Process notepad | Stop-Process
5050
The first command uses the `Get-Process` cmdlet to get an object representing
5151
the Notepad process. It uses a pipeline operator (`|`) to send the process
5252
object to the `Stop-Process` cmdlet, which stops the Notepad process. Notice
53-
that the `Stop-Process` command doesn't have a **Name** or **ID** parameter to
53+
that the `Stop-Process` command doesn't have a **Name** or **Id** parameter to
5454
specify the process, because the specified process is submitted through the
5555
pipeline.
5656

@@ -60,9 +60,9 @@ displays the name and length of each file in a table.
6060

6161
```powershell
6262
Get-ChildItem -Path *.txt |
63-
Where-Object {$_.length -gt 10000} |
64-
Sort-Object -Property length |
65-
Format-Table -Property name, length
63+
Where-Object {$_.Length -gt 10000} |
64+
Sort-Object -Property Length |
65+
Format-Table -Property Name, Length
6666
```
6767

6868
This pipeline consists of four commands in the specified order. The following
@@ -73,7 +73,7 @@ command in the pipeline.
7373
Get-ChildItem -Path *.txt
7474
| (FileInfo objects for *.txt)
7575
V
76-
Where-Object {$_.length -gt 10000}
76+
Where-Object {$_.Length -gt 10000}
7777
| (FileInfo objects for *.txt)
7878
| ( Length > 10000 )
7979
V
@@ -82,7 +82,7 @@ Sort-Object -Property Length
8282
| ( Length > 10000 )
8383
| ( Sorted by length )
8484
V
85-
Format-Table -Property name, length
85+
Format-Table -Property Name, Length
8686
| (FileInfo objects for *.txt)
8787
| ( Length > 10000 )
8888
| ( Sorted by length )
@@ -110,7 +110,7 @@ Get-Service wmi | Start-Service
110110
```
111111

112112
For another example, you can pipe the output of `Get-Item` or `Get-ChildItem`
113-
within the PowerShell registry provider to the `New-ItemProperty` cmdlet. This
113+
within the PowerShell Registry provider to the `New-ItemProperty` cmdlet. This
114114
example adds a new registry entry, **NoOfEmployees**, with a value of **8124**,
115115
to the **MyCompany** registry key.
116116

@@ -126,11 +126,11 @@ how to sort all the processes on the computer by the number of open handles in
126126
each process.
127127

128128
```powershell
129-
Get-Process | Sort-Object -Property handles
129+
Get-Process | Sort-Object -Property Handles
130130
```
131131

132132
You can pipe objects to the formatting, export, and output cmdlets, such as
133-
`Format-List`, `Format-Table`, `Export-Clixml`, `Export-CSV`, and `Out-File`.
133+
`Format-List`, `Format-Table`, `Export-Clixml`, `Export-Csv`, and `Out-File`.
134134

135135
This example shows how to use the `Format-List` cmdlet to display a list of
136136
properties for a process object.
@@ -391,7 +391,7 @@ use that to count the number of processes running on the computer.
391391
For example,
392392

393393
```powershell
394-
(Get-Process).count
394+
(Get-Process).Count
395395
```
396396

397397
It's important to remember that objects sent down the pipeline are delivered
@@ -564,7 +564,7 @@ enhances readability.
564564
- [about_Objects][05]
565565
- [about_Parameters][06]
566566
- [about_Command_Syntax][03]
567-
- [about_ForEach][04]
567+
- [about_Foreach][04]
568568

569569
<!-- link references -->
570570
[02]: #investigating-pipeline-errors

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ PowerShell includes the following environment variables that store user
6262
preferences. For more information about these environment variables, see
6363
[about_Environment_Variables][30].
6464

65-
- `$env:PSExecutionPolicyPreference`
66-
- `$env:PSModulePath`
65+
- `$Env:PSExecutionPolicyPreference`
66+
- `$Env:PSModulePath`
6767

6868
> [!NOTE]
6969
> Changes to preference variables apply only in the scope they are made
@@ -549,7 +549,7 @@ ObjectNotFound: (C:\nofile.txt:String) [Get-ChildItem], ItemNotFoundException
549549
This example demonstrates that the value of `$ErrorView` only affects the error
550550
display. It doesn't change the structure of the error object that's stored in
551551
the `$Error` automatic variable. For information about the `$Error` automatic
552-
variable, see [about_automatic_variables][28].
552+
variable, see [about_Automatic_Variables][28].
553553

554554
The following command takes the **ErrorRecord** object associated with the most
555555
recent error in the error array, **element 0**, and formats the properties of
@@ -739,14 +739,14 @@ To enable a **Log*Event**, type the variable with a value of `$true`, for
739739
example:
740740

741741
```powershell
742-
$LogCommandLifeCycleEvent = $true
742+
$LogCommandLifecycleEvent = $true
743743
```
744744

745745
To disable an event type, type the variable with a value of `$false`, for
746746
example:
747747

748748
```powershell
749-
$LogCommandLifeCycleEvent = $false
749+
$LogCommandLifecycleEvent = $false
750750
```
751751

752752
The events that you enable are effective only for the current PowerShell
@@ -766,7 +766,7 @@ value is **4096** and that should be enough for most uses. You can adjust
766766
To count the aliases on your system, type:
767767

768768
```powershell
769-
(Get-Alias).count
769+
(Get-Alias).Count
770770
```
771771

772772
## $MaximumDriveCount
@@ -782,7 +782,7 @@ providers and appear as drives, such as the `Alias:` and `HKLM:` drives.
782782
To count the aliases on your system, type:
783783

784784
```powershell
785-
(Get-PSDrive).count
785+
(Get-PSDrive).Count
786786
```
787787

788788
## $MaximumErrorCount
@@ -801,7 +801,7 @@ To count the errors on your system, use the `$Error` array's **Count**
801801
property.
802802

803803
```powershell
804-
$Error.count
804+
$Error.Count
805805
```
806806

807807
To display a specific error, use the `[0]` array notation to see the most
@@ -1016,7 +1016,7 @@ try {
10161016
$buffer = [byte[]]::new(1024)
10171017
$read = $inputStream.Read($buffer, 0, $buffer.Length)
10181018
$actual = [byte[]]::new($read)
1019-
[Array]::Copy($buffer, $actual, $read)
1019+
[array]::Copy($buffer, $actual, $read)
10201020
Format-Hex -InputObject $actual
10211021
} finally {
10221022
$inputStream.Dispose()
@@ -1093,16 +1093,16 @@ Specifies the default email server that's used to send email messages. This
10931093
preference variable is used by cmdlets that send email, such as the
10941094
[Send-MailMessage][49] cmdlet.
10951095

1096-
## $PSModuleAutoloadingPreference
1096+
## $PSModuleAutoLoadingPreference
10971097

10981098
Enables and disables automatic importing of modules in the session. The
1099-
`$PSModuleAutoloadingPreference` variable doesn't exist by default. The default
1099+
`$PSModuleAutoLoadingPreference` variable doesn't exist by default. The default
11001100
behavior when the variable isn't defined is the same as
1101-
`$PSModuleAutoloadingPreference = 'All'`.
1101+
`$PSModuleAutoLoadingPreference = 'All'`.
11021102

11031103
To automatically import a module, get or use a command contained in the module.
11041104

1105-
The `$PSModuleAutoloadingPreference` variable takes one of the
1105+
The `$PSModuleAutoLoadingPreference` variable takes one of the
11061106
[`PSModuleAutoLoadingPreference`][58] enumeration values:
11071107

11081108
- `All`: Modules are imported automatically on first-use.
@@ -1700,7 +1700,7 @@ At line:1 char:1
17001700

17011701
## See also
17021702

1703-
- [about_automatic_variables][28]
1703+
- [about_Automatic_Variables][28]
17041704
- [about_CommonParameters][29]
17051705
- [about_Environment_Variables][30]
17061706
- [about_Profiles][36]

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ Here are a few suggestions to get you started.
205205
### Add a function that lists aliases for any cmdlet
206206

207207
```powershell
208-
function Get-CmdletAlias ($cmdletname) {
208+
function Get-CmdletAlias ($cmdletName) {
209209
Get-Alias |
210-
Where-Object -FilterScript {$_.Definition -like "$cmdletname"} |
210+
Where-Object -FilterScript {$_.Definition -like "$cmdletName"} |
211211
Format-Table -Property Definition, Name -AutoSize
212212
}
213213
```
@@ -216,9 +216,9 @@ function Get-CmdletAlias ($cmdletname) {
216216

217217
```powershell
218218
function CustomizeConsole {
219-
$hosttime = (Get-ChildItem -Path $PSHOME\PowerShell.exe).CreationTime
220-
$hostversion="$($Host.Version.Major)`.$($Host.Version.Minor)"
221-
$Host.UI.RawUI.WindowTitle = "PowerShell $hostversion ($hosttime)"
219+
$hostTime = (Get-ChildItem -Path $PSHOME\powershell.exe).CreationTime
220+
$hostVersion="$($Host.Version.Major)`.$($Host.Version.Minor)"
221+
$Host.UI.RawUI.WindowTitle = "PowerShell $hostVersion ($hostTime)"
222222
Clear-Host
223223
}
224224
CustomizeConsole
@@ -227,8 +227,8 @@ CustomizeConsole
227227
### Add a customized PowerShell prompt
228228

229229
```powershell
230-
function Prompt {
231-
$env:COMPUTERNAME + "\" + (Get-Location) + "> "
230+
function prompt {
231+
$Env:COMPUTERNAME + "\" + (Get-Location) + "> "
232232
}
233233
```
234234

0 commit comments

Comments
 (0)