Skip to content

Commit efb767a

Browse files
Fix incorrect case/capitalization in ref docs (#11932)
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 1474803 commit efb767a

40 files changed

+164
-164
lines changed

reference/5.1/Microsoft.PowerShell.Utility/Invoke-WebRequest.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,23 @@ This cmdlet was introduced in Windows PowerShell 3.0.
5050
This example uses the `Invoke-WebRequest` cmdlet to send a web request to the Bing.com site.
5151

5252
```powershell
53-
$Response = Invoke-WebRequest -UseBasicParsing -URI https://www.bing.com?q=how+many+feet+in+a+mile
53+
$Response = Invoke-WebRequest -UseBasicParsing -Uri https://www.bing.com?q=how+many+feet+in+a+mile
5454
$Response.InputFields |
55-
Where-Object name -like "* Value" |
56-
Select-Object name, value
55+
Where-Object Name -Like "* Value" |
56+
Select-Object Name, Value
5757
```
5858

5959
```Output
60-
name value
60+
Name Value
6161
---- -----
6262
From Value 1
6363
To Value 5280
6464
```
6565

6666
The data returned by `Invoke-WebRequest` is stored in the `$Response` variable. The **InputFields**
6767
property of the response contains the form fields. `Where-Object` is used to filter the form fields
68-
to those where the **name** property is like "* Value". The filtered results are piped to
69-
`Select-Object` to select the **name** and **value** properties.
68+
to those where the **Name** property is like "* Value". The filtered results are piped to
69+
`Select-Object` to select the **Name** and **Value** properties.
7070

7171
### Example 2: Use a stateful web service
7272

@@ -77,8 +77,8 @@ Facebook.
7777
$R = Invoke-WebRequest https://www.facebook.com/login.php -SessionVariable fb
7878
# This command stores the first form in the Forms property of the $R variable in the $Form variable.
7979
$Form = $R.Forms[0]
80-
# This command shows the fields available in the Form.
81-
$Form.fields
80+
# This command shows the fields available in the form.
81+
$Form.Fields
8282
```
8383

8484
```Output
@@ -91,7 +91,7 @@ pass
9191
```
9292

9393
```powershell
94-
# These commands populate the username and password of the respective Form fields.
94+
# These commands populate the username and password of the respective form fields.
9595
$Form.Fields["email"]="[email protected]"
9696
$Form.Fields["pass"]="P@ssw0rd"
9797
# This command creates the Uri that will be used to log in to facebook.
@@ -101,7 +101,7 @@ $Uri = "https://www.facebook.com" + $Form.Action
101101
# The WebRequestSession object in the $FB variable is passed as the value of the WebSession parameter.
102102
# The value of the Body parameter is the hash table in the Fields property of the form.
103103
# The value of the *Method* parameter is POST. The command saves the output in the $R variable.
104-
$R = Invoke-WebRequest -Uri $Uri -WebSession $FB -Method POST -Body $Form.Fields
104+
$R = Invoke-WebRequest -Uri $Uri -WebSession $FB -Method Post -Body $Form.Fields
105105
$R.StatusDescription
106106
```
107107

@@ -181,7 +181,7 @@ $jobs = @()
181181
182182
foreach ($file in $files) {
183183
$jobs += Start-ThreadJob -Name $file.OutFile -ScriptBlock {
184-
$params = $using:file
184+
$params = $Using:file
185185
Invoke-WebRequest @params
186186
}
187187
}

reference/5.1/Microsoft.PowerShell.Utility/Measure-Command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This example measures the time it takes to run a `Get-EventLog` command that get
3535
Windows PowerShell event log.
3636

3737
```powershell
38-
Measure-Command { Get-EventLog "windows powershell" }
38+
Measure-Command { Get-EventLog "Windows PowerShell" }
3939
```
4040

4141
### Example 2: Compare two outputs from Measure-Command

reference/5.1/Microsoft.PowerShell.Utility/Measure-Object.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This command displays the **Minimum**, **Maximum**, and **Sum** of the sizes of
5757
current directory, and the average size of a file in the directory.
5858

5959
```powershell
60-
Get-ChildItem | Measure-Object -Property length -Minimum -Maximum -Sum -Average
60+
Get-ChildItem | Measure-Object -Property Length -Minimum -Maximum -Sum -Average
6161
```
6262

6363
### Example 3: Measure text in a text file
@@ -124,7 +124,7 @@ You can use `Measure-Object` to calculate the values of these properties, just l
124124
property of an object.
125125

126126
```powershell
127-
Import-Csv d:\test\serviceyrs.csv | Measure-Object -Property years -Minimum -Maximum -Average
127+
Import-Csv D:\test\serviceyrs.csv | Measure-Object -Property Years -Minimum -Maximum -Average
128128
```
129129

130130
### Example 6: Measure Boolean values
@@ -134,7 +134,7 @@ In this case, it uses the **PSIsContainer** **Boolean** property to measure the
134134
folders (vs. files) in the current directory.
135135

136136
```powershell
137-
Get-ChildItem | Measure-Object -Property psiscontainer -Maximum -Sum -Minimum -Average
137+
Get-ChildItem | Measure-Object -Property PSIsContainer -Maximum -Sum -Minimum -Average
138138
```
139139

140140
```Output

reference/5.1/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Creates table-like custom objects from the items in a character-separated value
181181
Imports language-specific data into scripts and functions based on the UI culture that is selected for the operating system.
182182

183183
### [Import-PowerShellDataFile](Import-PowerShellDataFile.md)
184-
Imports values from a `.PSD1` file without invoking its contents.
184+
Imports values from a `.psd1` file without invoking its contents.
185185

186186
### [Import-PSSession](Import-PSSession.md)
187187
Imports commands from another session into the current session.

reference/5.1/Microsoft.PowerShell.Utility/New-Alias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ This command creates an alias named List to represent the Get-ChildItem cmdlet.
4040
### Example 2: Create a read-only alias for a cmdlet
4141

4242
This command creates an alias named `C` to represent the `Get-ChildItem` cmdlet. It creates a
43-
description of "quick gci alias" for the alias and makes it read-only.
43+
description of "Quick gci alias" for the alias and makes it read-only.
4444

4545
```powershell
46-
New-Alias -Name "C" -Value Get-ChildItem -Description "quick gci alias" -Option ReadOnly
46+
New-Alias -Name "C" -Value Get-ChildItem -Description "Quick gci alias" -Option ReadOnly
4747
Get-Alias -Name "C" | Format-List *
4848
```
4949

@@ -55,7 +55,7 @@ ReferencedCommand : Get-ChildItem
5555
ResolvedCommand : Get-ChildItem
5656
Definition : Get-ChildItem
5757
Options : ReadOnly
58-
Description : quick gci alias
58+
Description : Quick gci alias
5959
OutputType : {System.IO.FileInfo, System.IO.DirectoryInfo}
6060
Name : C
6161
CommandType : Alias

reference/5.1/Microsoft.PowerShell.Utility/New-Event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ must change the program conditions or close the PowerShell session.
4343
### Example 1: Create a new event in the event queue
4444

4545
```
46-
PS C:\> New-Event -SourceIdentifier Timer -Sender windows.timer -MessageData "Test"
46+
PS C:\> New-Event -SourceIdentifier Timer -Sender Windows.Timer -MessageData "Test"
4747
```
4848

4949
This command creates a new event in the PowerShell event queue. It uses a **Windows.Timer** object
@@ -59,7 +59,7 @@ PS C:\> function Enable-ProcessCreationEvent
5959
$Identifier = "WMI.ProcessCreated"
6060
Register-ObjectEvent $ProcessWatcher "EventArrived" -SupportEvent $Identifier -Action
6161
{
62-
[void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $args[0] -EventArguments $args[1].SourceEventArgs.NewEvent.TargetInstance)
62+
[void] (New-Event -SourceId "PowerShell.ProcessCreated" -Sender $args[0] -EventArguments $args[1].SourceEventArgs.NewEvent.TargetInstance)
6363
}
6464
}
6565
```

reference/5.1/Microsoft.PowerShell.Utility/New-Object.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ method and set the **Visible** property of the object to `$true` to make the app
6060
The second instance gets the same results with individual commands.
6161

6262
```powershell
63-
$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $true}
63+
$IE1 = New-Object -ComObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $true}
6464
6565
# The following command gets the same results as the example above.
66-
$IE2 = New-Object -COMObject InternetExplorer.Application`
66+
$IE2 = New-Object -ComObject InternetExplorer.Application`
6767
$IE2.Navigate2("www.microsoft.com")`
6868
$IE2.Visible = $true`
6969
```
@@ -74,7 +74,7 @@ This example demonstrates that adding the **Strict** parameter causes the `New-O
7474
generate a non-terminating error when the COM object uses an interop assembly.
7575

7676
```powershell
77-
$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $true}
77+
$A = New-Object -ComObject Word.Application -Strict -Property @{Visible = $true}
7878
```
7979

8080
```Output
@@ -84,24 +84,24 @@ this type exposes different members than the IDispatch members, scripts written
8484
object might not work if the primary interop assembly is not installed.
8585
8686
At line:1 char:14
87-
+ $A = New-Object <<<< -COM Word.Application -Strict; $a.visible=$true
87+
+ $A = New-Object <<<< -ComObject Word.Application -Strict; $a.Visible=$true
8888
```
8989

9090
### Example 4: Create a COM object to manage Windows desktop
9191

9292
This example shows how to create and use a COM object to manage your Windows desktop.
9393

9494
The first command uses the **ComObject** parameter of the `New-Object` cmdlet to create a COM object
95-
with the **Shell.Application** ProgID. It stores the resulting object in the `$ObjShell` variable. The
96-
second command pipes the `$ObjShell` variable to the `Get-Member` cmdlet, which displays the
95+
with the **Shell.Application** ProgID. It stores the resulting object in the `$objShell` variable. The
96+
second command pipes the `$objShell` variable to the `Get-Member` cmdlet, which displays the
9797
properties and methods of the COM object. Among the methods is the **ToggleDesktop** method. The
9898
third command calls the **ToggleDesktop** method of the object to minimize the open windows on your
9999
desktop.
100100

101101
```powershell
102-
$Objshell = New-Object -COMObject "Shell.Application"
103-
$objshell | Get-Member
104-
$objshell.ToggleDesktop()
102+
$objShell = New-Object -ComObject "Shell.Application"
103+
$objShell | Get-Member
104+
$objShell.ToggleDesktop()
105105
```
106106

107107
```Output
@@ -324,7 +324,7 @@ This cmdlet returns the object that it creates.
324324

325325
- `New-Object` provides the most commonly-used functionality of the VBScript CreateObject
326326
function. A statement like `Set objShell = CreateObject("Shell.Application")` in VBScript can be
327-
translated to `$objShell = New-Object -COMObject "Shell.Application"` in PowerShell.
327+
translated to `$objShell = New-Object -ComObject "Shell.Application"` in PowerShell.
328328
- `New-Object` expands upon the functionality available in the Windows Script Host environment by
329329
making it easy to work with .NET Framework objects from the command line and within scripts.
330330

reference/5.1/Microsoft.PowerShell.Utility/New-TimeSpan.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ These commands return the date that is 90 days after the current date.
8484

8585
### Example 4: Discover the TimeSpan since a file was updated
8686

87-
This command tells you how long it has been since the [about_remote](../Microsoft.PowerShell.Core/About/about_Remote.md)
87+
This command tells you how long it has been since the [about_Remote](../Microsoft.PowerShell.Core/About/about_Remote.md)
8888
help file was last updated.
8989
You can use this command format on any file, or any other object that has a **LastWriteTime**
9090
property.
@@ -94,7 +94,7 @@ This command works because the **Start** parameter of `New-TimeSpan` has an alia
9494
PowerShell uses the value of the **LastWriteTime** property as the value of the **Start** parameter.
9595

9696
```powershell
97-
Get-ChildItem $PSHOME\en-us\about_remote.help.txt | New-TimeSpan
97+
Get-ChildItem $PSHOME\en-US\about_remote.help.txt | New-TimeSpan
9898
```
9999

100100
```Output
@@ -200,13 +200,13 @@ Accept wildcard characters: False
200200
201201
### -Start
202202
203-
Specifies the start of a time span.
204-
Enter a string that represents the date and time, such as "3/15/09" or a **DateTime** object, such
205-
as one from a `Get-Date` command. The default value is the current date and time.
203+
Specifies the start of a time span. Enter a string that represents the date and time, such as
204+
"3/15/09" or a **DateTime** object, such as one from a `Get-Date` command. The default value is the
205+
current date and time.
206206

207-
You can use **Start** or its alias, **LastWriteTime**.
208-
The **LastWriteTime** alias lets you pipe objects that have a **LastWriteTime** property,
209-
such as files in the file system `[System.Io.FileIO]`, to the **Start** parameter of `New-TimeSpan`.
207+
You can use **Start** or its alias, **LastWriteTime**. The **LastWriteTime** alias lets you pipe
208+
objects that have a **LastWriteTime** property, such as files in the file system (`[IO.FileInfo]`),
209+
to the **Start** parameter of `New-TimeSpan`.
210210

211211
```yaml
212212
Type: System.DateTime

reference/5.1/Microsoft.PowerShell.Utility/New-Variable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ using a binary-OR operation. Passing values as an array is the simplest option a
216216
to use tab-completion on the values.
217217

218218
To see the Options property of all variables in the session, type
219-
`Get-Variable | Format-Table -Property name, options -AutoSize`.
219+
`Get-Variable | Format-Table -Property Name, Options -AutoSize`.
220220

221221
```yaml
222222
Type: System.Management.Automation.ScopedItemOptions

reference/5.1/Microsoft.PowerShell.Utility/Out-File.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ This example shows how to encode output with a specific encoding type.
9191

9292
```powershell
9393
$Procs = Get-Process
94-
Out-File -FilePath .\Process.txt -InputObject $Procs -Encoding ASCII -Width 50
94+
Out-File -FilePath .\Process.txt -InputObject $Procs -Encoding ascii -Width 50
9595
```
9696

9797
The `Get-Process` cmdlet gets the list of processes running on the local computer. The **Process**
@@ -145,7 +145,7 @@ of 2000 instead of a line width determined by the PowerShell host's console widt
145145
```powershell
146146
function DemoDefaultOutFileWidth() {
147147
try {
148-
$PSDefaultParameterValues['out-file:width'] = 2000
148+
$PSDefaultParameterValues['Out-File:Width'] = 2000
149149
150150
$logFile = "$PWD\logfile.txt"
151151
@@ -158,7 +158,7 @@ function DemoDefaultOutFileWidth() {
158158
Get-Process | Format-Table Id,SI,Name,Path,MainWindowTitle >> $logFile
159159
}
160160
finally {
161-
$PSDefaultParameterValues.Remove('out-file:width')
161+
$PSDefaultParameterValues.Remove('Out-File:Width')
162162
}
163163
}
164164
@@ -330,7 +330,7 @@ Specifies the maximum number of characters in each line of output. Any additiona
330330
truncated, not wrapped. If this parameter isn't used, the width is determined by the
331331
characteristics of the host. The default for the PowerShell console is 80 characters. If you want
332332
to control the width for all invocations of `Out-File` as well as the redirection operators (`>`
333-
and `>>`), set `$PSDefaultParameterValues['out-file:width'] = 2000` before using `Out-File`.
333+
and `>>`), set `$PSDefaultParameterValues['Out-File:Width'] = 2000` before using `Out-File`.
334334

335335
```yaml
336336
Type: System.Int32

reference/7.4/Microsoft.PowerShell.Utility/Invoke-WebRequest.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ you need a different encoding, you must set the `charset` attribute in the `Cont
110110
This example uses the `Invoke-WebRequest` cmdlet to send a web request to the Bing.com site.
111111

112112
```powershell
113-
$Response = Invoke-WebRequest -URI https://www.bing.com/search?q=how+many+feet+in+a+mile
113+
$Response = Invoke-WebRequest -Uri https://www.bing.com/search?q=how+many+feet+in+a+mile
114114
$Response.InputFields | Where-Object {
115-
$_.name -like "* Value*"
115+
$_.Name -like "* Value*"
116116
} | Select-Object Name, Value
117117
```
118118

119119
```Output
120-
name value
120+
Name Value
121121
---- -----
122122
From Value 1
123123
To Value 5280
@@ -193,18 +193,18 @@ Note that the **Encoding** property is null if the web request doesn't return te
193193
### Example 5: Submit a multipart/form-data file
194194

195195
This example uses the `Invoke-WebRequest` cmdlet upload a file as a `multipart/form-data`
196-
submission. The file `c:\document.txt` is submitted as the form field `document` with the
196+
submission. The file `C:\document.txt` is submitted as the form field `document` with the
197197
`Content-Type` of `text/plain`.
198198

199199
```powershell
200-
$FilePath = 'c:\document.txt'
200+
$FilePath = 'C:\document.txt'
201201
$FieldName = 'document'
202202
$ContentType = 'text/plain'
203203
204204
$FileStream = [System.IO.FileStream]::new($filePath, [System.IO.FileMode]::Open)
205205
$FileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new('form-data')
206206
$FileHeader.Name = $FieldName
207-
$FileHeader.FileName = Split-Path -leaf $FilePath
207+
$FileHeader.FileName = Split-Path -Leaf $FilePath
208208
$FileContent = [System.Net.Http.StreamContent]::new($FileStream)
209209
$FileContent.Headers.ContentDisposition = $FileHeader
210210
$FileContent.Headers.ContentType = [System.Net.Http.Headers.MediaTypeHeaderValue]::Parse($ContentType)
@@ -226,7 +226,7 @@ $Form = @{
226226
firstName = 'John'
227227
lastName = 'Doe'
228228
229-
avatar = Get-Item -Path 'c:\Pictures\jdoe.png'
229+
avatar = Get-Item -Path 'C:\Pictures\jdoe.png'
230230
birthday = '1980-10-15'
231231
hobbies = 'Hiking','Fishing','Jogging'
232232
}
@@ -303,7 +303,7 @@ $jobs = @()
303303
304304
foreach ($file in $files) {
305305
$jobs += Start-ThreadJob -Name $file.OutFile -ScriptBlock {
306-
$params = $using:file
306+
$params = $Using:file
307307
Invoke-WebRequest @params
308308
}
309309
}
@@ -671,7 +671,7 @@ be used together.
671671

672672
This example makes a `TEST` HTTP request to the API:
673673

674-
`Invoke-WebRequest -uri 'https://api.contoso.com/widget/' -CustomMethod 'TEST'`
674+
`Invoke-WebRequest -Uri 'https://api.contoso.com/widget/' -CustomMethod 'TEST'`
675675

676676
This feature was added in PowerShell 6.0.0.
677677

@@ -720,7 +720,7 @@ object.
720720

721721
```powershell
722722
$Form = @{
723-
resume = Get-Item 'c:\Users\jdoe\Documents\John Doe.pdf'
723+
resume = Get-Item 'C:\Users\jdoe\Documents\John Doe.pdf'
724724
}
725725
```
726726

@@ -731,7 +731,7 @@ object, then the binary file contents are submitted. Nested collections aren't s
731731
```powershell
732732
$Form = @{
733733
tags = 'Vacation', 'Italy', '2017'
734-
pictures = Get-ChildItem 'c:\Users\jdoe\Pictures\2017-Italy\'
734+
pictures = Get-ChildItem 'C:\Users\jdoe\Pictures\2017-Italy\'
735735
}
736736
```
737737

reference/7.4/Microsoft.PowerShell.Utility/Measure-Command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This example measures the time it takes to run a `Get-EventLog` command that get
3535
Windows PowerShell event log.
3636

3737
```powershell
38-
Measure-Command { Get-EventLog "windows powershell" }
38+
Measure-Command { Get-EventLog "Windows PowerShell" }
3939
```
4040

4141
### Example 2: Compare two outputs from Measure-Command

0 commit comments

Comments
 (0)