Skip to content

Commit 5aa8bad

Browse files
Fix incorrect case/capitalization in ref docs (#11915)
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 04be64e commit 5aa8bad

40 files changed

Lines changed: 232 additions & 232 deletions

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ title: about_PSModulePath
1010

1111
## Short description
1212

13-
This article describes the purpose and usage of the `$env:PSModulePath`
13+
This article describes the purpose and usage of the `$Env:PSModulePath`
1414
environment variable.
1515

1616
## Long description
1717

18-
The `$env:PSModulePath` environment variable contains a list of folder
18+
The `$Env:PSModulePath` environment variable contains a list of folder
1919
locations. PowerShell recursively searches each folder for module (`.psd1` or
2020
`.psm1`) files.
2121

22-
By default, the effective locations assigned to `$env:PSModulePath` are:
22+
By default, the effective locations assigned to `$Env:PSModulePath` are:
2323

2424
- Modules installed in the **CurrentUser** scope are stored in
2525
`$HOME\Documents\WindowsPowerShell\Modules`.
2626
- Modules installed in the **AllUsers** scope are stored in
27-
`$env:ProgramFiles\WindowsPowerShell\Modules`.
27+
`$Env:ProgramFiles\WindowsPowerShell\Modules`.
2828
- Modules that ship with Windows PowerShell stored in `$PSHOME\Modules`, which
29-
is `$env:SystemRoot\System32\WindowsPowerShell\1.0\Modules`.
29+
is `$Env:SystemRoot\System32\WindowsPowerShell\1.0\Modules`.
3030

3131
## PowerShell PSModulePath construction
3232

33-
The value of `$env:PSModulePath` is constructed each time PowerShell starts.
33+
The value of `$Env:PSModulePath` is constructed each time PowerShell starts.
3434
The value varies by version of PowerShell and how you launched it.
3535

3636
### Windows PowerShell startup
@@ -48,8 +48,8 @@ startup:
4848
the `$PSHOME` location
4949

5050
The **CurrentUser** module path is prefixed only if the User scope
51-
`$env:PSModulePath` doesn't exist. Otherwise, the User scope
52-
`$env:PSModulePath` is used as defined.
51+
`$Env:PSModulePath` doesn't exist. Otherwise, the User scope
52+
`$Env:PSModulePath` is used as defined.
5353

5454
## Module search behavior
5555

@@ -78,7 +78,7 @@ locations. However, you might need to change the value of the `PSModulePath`
7878
environment variable.
7979

8080
For example, to temporarily add the `C:\Program Files\Fabrikam\Modules`
81-
directory to `$env:PSModulePath` for the current session, type:
81+
directory to `$Env:PSModulePath` for the current session, type:
8282

8383
```powershell
8484
$Env:PSModulePath = $Env:PSModulePath+";C:\Program Files\Fabrikam\Modules"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ the here-string, all quotation marks are interpreted literally. For example:
283283

284284
```powershell
285285
@"
286-
For help, type "get-help"
286+
For help, type "Get-Help"
287287
"@
288288
```
289289

290290
The output of this command is:
291291

292292
```Output
293-
For help, type "get-help"
293+
For help, type "Get-Help"
294294
```
295295

296296
Using a here-string can simplify using a string in a command. For example:
@@ -347,7 +347,7 @@ Here-strings are typically used to assign multiple lines to a variable. For
347347
example, the following here-string assigns a page of XML to the $page variable.
348348

349349
```powershell
350-
$page = [XML] @"
350+
$page = [xml] @"
351351
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10"
352352
xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10"
353353
xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Get-Item /not-here 2>&1 >> log.txt
153153
154154
$ErrorActionPreference = 'Stop'
155155
$ErrorActionPreference >> log.txt
156-
Try {
156+
try {
157157
Get-Item /not-here 2>&1 >> log.txt
158158
}
159159
catch {
@@ -181,7 +181,7 @@ Can't find path 'C:\not-here' because it doesn't exist.
181181
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): H
182182
Get-Item: C:\temp\test.ps1:23
183183
Line |
184-
23 | get-item /not-here 2>&1 >> log.txt
184+
23 | Get-Item /not-here 2>&1 >> log.txt
185185
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
186186
| The running command stopped because the user selected the Stop option.
187187
```
@@ -194,7 +194,7 @@ Continue
194194
195195
Get-Item: C:\temp\test.ps1:3
196196
Line |
197-
3 | get-item /not-here 2>&1 >> log.txt
197+
3 | Get-Item /not-here 2>&1 >> log.txt
198198
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199199
| Cannot find path 'C:\not-here' because it does not exist.
200200
@@ -252,7 +252,7 @@ redirection operators as well. Put the following command near the top of your
252252
script to set `Out-File:Width` for the whole script:
253253

254254
```powershell
255-
$PSDefaultParameterValues['out-file:width'] = 2000
255+
$PSDefaultParameterValues['Out-File:Width'] = 2000
256256
```
257257

258258
Increasing the output width will increase memory consumption when logging
@@ -264,7 +264,7 @@ you will need to pipe the output through `Format-Table -AutoSize` before
264264
outputting to file.
265265

266266
```powershell
267-
$PSDefaultParameterValues['out-file:width'] = 2000
267+
$PSDefaultParameterValues['Out-File:Width'] = 2000
268268
Get-Service | Format-Table -AutoSize > services.log
269269
```
270270

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ to it. In PowerShell, integers are value types so they're passed by value.
3232
Therefore, the value of `$var` is unchanged outside the scope of the function.
3333

3434
```powershell
35-
Function Test($data)
35+
Function Test($Data)
3636
{
37-
$data = 3
37+
$Data = 3
3838
}
3939
4040
$var = 10
41-
Test -data $var
41+
Test -Data $var
4242
$var
4343
```
4444

@@ -54,13 +54,13 @@ When passing a variable _by reference_, the function can change the data and
5454
that change persists after the function executes.
5555

5656
```powershell
57-
Function Test($data)
57+
Function Test($Data)
5858
{
59-
$data.Test = "New Text"
59+
$Data.Test = "New Text"
6060
}
6161
6262
$var = @{}
63-
Test -data $var
63+
Test -Data $var
6464
$var
6565
```
6666

@@ -84,8 +84,8 @@ access your data.
8484

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

@@ -97,7 +97,7 @@ your variable as a reference.
9797
9898
```powershell
9999
$var = 10
100-
Test -data ([ref]$var)
100+
Test -Data ([ref]$var)
101101
$var
102102
```
103103

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ ContosoCompany registry key.
335335

336336
```powershell
337337
$path = "HKLM:\SOFTWARE\ContosoCompany"
338-
New-ItemProperty -Path $path -Name Test -Type DWORD -Value 1
338+
New-ItemProperty -Path $path -Name Test -Type DWord -Value 1
339339
```
340340

341341
> [!NOTE]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ input strings.
230230
There's a static method of the regex class that can escape text for you.
231231

232232
```powershell
233-
[regex]::escape('3.\d{2,}')
233+
[regex]::Escape('3.\d{2,}')
234234
```
235235

236236
```Output

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ in the same PSSession that uses the `$p` variable. The following command counts
145145
the number of processes saved in `$p`.
146146

147147
```powershell
148-
Invoke-Command -Session $s -ScriptBlock {$p.count}
148+
Invoke-Command -Session $s -ScriptBlock {$p.Count}
149149
```
150150

151151
## How to run a remote command on multiple computers

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ all of the operations occur on the remote computer, not the local computer.
137137
results of the job in the PsLog.txt file on the Server01 computer.
138138

139139
```powershell
140-
Server01\C:> Receive-Job $job > c:\logs\PsLog.txt
140+
Server01\C:> Receive-Job $job > C:\logs\PsLog.txt
141141
```
142142

143143
1. To end the interactive session, use the `Exit-PSSession` cmdlet. The command
@@ -164,7 +164,7 @@ all of the operations occur on the remote computer, not the local computer.
164164
```powershell
165165
$s = New-PSSession -ComputerName Server01
166166
Invoke-Command -Session $s -ScriptBlock {
167-
Get-Content c:\logs\pslog.txt}
167+
Get-Content C:\logs\pslog.txt}
168168
```
169169

170170
### Start a remote job that returns the results to the local computer (AsJob)
@@ -189,16 +189,16 @@ requirements for remoting.
189189
assign a display name to the job.
190190

191191
```powershell
192-
Invoke-Command -Computername Server01 -ScriptBlock {
193-
Get-EventLog system} -AsJob
192+
Invoke-Command -ComputerName Server01 -ScriptBlock {
193+
Get-EventLog System} -AsJob
194194
```
195195

196196
The results of the command resemble the following sample output.
197197

198198
```Output
199199
SessionId Name State HasMoreData Location Command
200200
--------- ---- ----- ----------- -------- -------
201-
1 Job1 Running True Server01 Get-EventLog system
201+
1 Job1 Running True Server01 Get-EventLog System
202202
```
203203

204204
When the **AsJob** parameter is used, `Invoke-Command` returns the same type
@@ -228,7 +228,7 @@ requirements for remoting.
228228
```Output
229229
SessionId Name State HasMoreData Location Command
230230
--------- ---- ----- ----------- -------- -------
231-
1 Job1 Completed True Server01 Get-EventLog system
231+
1 Job1 Completed True Server01 Get-EventLog System
232232
```
233233

234234
1. To get the results of the job, use the `Receive-Job` cmdlet. Because the job
@@ -279,15 +279,15 @@ commands remotely to manage a local job on the remote computer.
279279

280280
```powershell
281281
Invoke-Command -Session $s -ScriptBlock {
282-
Start-Job -ScriptBlock {Get-EventLog system}}
282+
Start-Job -ScriptBlock {Get-EventLog System}}
283283
```
284284

285285
The results resemble the following sample output.
286286

287287
```Output
288288
Id Name State HasMoreData Location Command
289289
-- ---- ----- ----------- -------- -------
290-
2 Job2 Running True Localhost Get-EventLog system
290+
2 Job2 Running True Localhost Get-EventLog System
291291
```
292292

293293
When you run a `Start-Job` command remotely, `Invoke-Command` returns the
@@ -318,7 +318,7 @@ commands remotely to manage a local job on the remote computer.
318318
```Output
319319
SessionId Name State HasMoreData Location Command
320320
--------- ---- ----- ----------- -------- -------
321-
2 Job2 Completed True LocalHost Get-EventLog system
321+
2 Job2 Completed True LocalHost Get-EventLog System
322322
```
323323

324324
1. To get the results of the job, use the `Invoke-Command` cmdlet to run a
@@ -342,7 +342,7 @@ commands remotely to manage a local job on the remote computer.
342342

343343
```powershell
344344
Invoke-Command -Session $s -Command {
345-
Receive-Job -SessionId 2 > c:\logs\pslog.txt
345+
Receive-Job -SessionId 2 > C:\logs\pslog.txt
346346
}
347347
```
348348

@@ -363,7 +363,7 @@ objects generated after the disconnect are returned when re-connected.
363363

364364
```powershell
365365
# Create remote session on local machine
366-
PS> $session = New-PSSession -cn localhost
366+
PS> $session = New-PSSession -Cn localhost
367367
368368
# Start remote job
369369
PS> $job = Invoke-Command -Session $session -ScriptBlock { 1..60 | % { sleep 1; "Output $_" } } -AsJob

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Administrator privileges are required for the following remoting operations:
143143
known as a "loopback" scenario.
144144
- Managing session configurations on the local computer.
145145
- Viewing and changing WS-Management settings on the local computer. These are
146-
the settings in the LocalHost node of the WSMAN: drive.
146+
the settings in the LocalHost node of the WSMan: drive.
147147

148148
You must start PowerShell with the **Run as administrator** option even if you
149149
are a member of the **Administrators** group on the local computer.

0 commit comments

Comments
 (0)