Skip to content

Commit a866a25

Browse files
Fix incorrect case/capitalization in reference documents (12/38) (#11919)
* 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). * Update PowerShell variable provider examples formatting Reformat code example --------- Co-authored-by: Sean Wheeler <[email protected]>
1 parent e9a3f92 commit a866a25

40 files changed

+190
-182
lines changed

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ PowerShell has the following type operators:
2929
- `-is` |Returns TRUE when the input is an instance of the specified .NET type.
3030

3131
```powershell
32-
(get-date) -is [DateTime] # Result is True
32+
(Get-Date) -is [datetime] # Result is True
3333
```
3434

3535
- `-isnot`|Returns TRUE when the input not an instance of the specified.NET type.
3636

3737
```powershell
38-
(get-date) -isnot [DateTime] # Result is False
38+
(Get-Date) -isnot [datetime] # Result is False
3939
```
4040

4141
- `-as` |Converts the input to the specified .NET type.
4242

4343
```powershell
44-
"5/7/07" -as [DateTime] # Result is Monday, May 7, 2007 12:00:00 AM
44+
"5/7/07" -as [datetime] # Result is Monday, May 7, 2007 12:00:00 AM
4545
```
4646

4747
The syntax of the type operators is as follows:
@@ -57,7 +57,7 @@ You can also use the following syntax:
5757
```
5858

5959
The .NET type can be written as a type name in brackets or a string, such as
60-
`[DateTime]` or `"DateTime"` for **System.DateTime**. If the type is not at the
60+
`[datetime]` or `"DateTime"` for **System.DateTime**. If the type is not at the
6161
root of the system namespace, specify the full name of the object type. You can
6262
omit "System.". For example, to specify **System.Diagnostics.Process**, enter
6363
`[System.Diagnostics.Process]`, `[Diagnostics.Process]`, or
@@ -113,7 +113,7 @@ System.IO.DirectoryInfo
113113

114114
#### Converting the DateTime type is culture-sensitive
115115

116-
Unlike type casting, converting to `[DateTime]` type using the `-as` operator
116+
Unlike type casting, converting to `[datetime]` type using the `-as` operator
117117
only works with strings that are formatted according to the rules of the
118118
current culture.
119119

@@ -148,25 +148,25 @@ System.Globalization.CultureInfo
148148
The following examples show some uses of the Type operators:
149149

150150
```powershell
151-
PS> 32 -is [Float]
151+
PS> 32 -is [float]
152152
False
153153
154154
PS> 32 -is "int"
155155
True
156156
157-
PS> (get-date) -is [DateTime]
157+
PS> (Get-Date) -is [datetime]
158158
True
159159
160-
PS> "12/31/2007" -is [DateTime]
160+
PS> "12/31/2007" -is [datetime]
161161
False
162162
163-
PS> "12/31/2007" -is [String]
163+
PS> "12/31/2007" -is [string]
164164
True
165165
166-
PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process]
166+
PS> (Get-Process powershell)[0] -is [System.Diagnostics.Process]
167167
True
168168
169-
PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo]
169+
PS> (Get-Command Get-Member) -is [System.Management.Automation.CmdletInfo]
170170
True
171171
```
172172

@@ -179,40 +179,40 @@ return **System.Globalization.CultureInfo** objects, a collection of these
179179
objects is a System.Object array.
180180

181181
```powershell
182-
PS> (get-culture) -is [System.Globalization.CultureInfo]
182+
PS> (Get-Culture) -is [System.Globalization.CultureInfo]
183183
True
184184
185-
PS> (get-uiculture) -is [System.Globalization.CultureInfo]
185+
PS> (Get-UICulture) -is [System.Globalization.CultureInfo]
186186
True
187187
188-
PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo]
188+
PS> (Get-Culture), (Get-UICulture) -is [System.Globalization.CultureInfo]
189189
False
190190
191-
PS> (get-culture), (get-uiculture) -is [Array]
191+
PS> (Get-Culture), (Get-UICulture) -is [array]
192192
True
193193
194-
PS> (get-culture), (get-uiculture) | foreach {
194+
PS> (Get-Culture), (Get-UICulture) | foreach {
195195
$_ -is [System.Globalization.CultureInfo])
196196
}
197197
True
198198
True
199199
200-
PS> (get-culture), (get-uiculture) -is [Object]
200+
PS> (Get-Culture), (Get-UICulture) -is [Object]
201201
True
202202
```
203203

204204
The following examples show how to use the `-as` operator.
205205

206206
```powershell
207-
PS> "12/31/07" -is [DateTime]
207+
PS> "12/31/07" -is [datetime]
208208
False
209209
210-
PS> "12/31/07" -as [DateTime]
210+
PS> "12/31/07" -as [datetime]
211211
Monday, December 31, 2007 12:00:00 AM
212212
213-
PS> $date = "12/31/07" -as [DateTime]
213+
PS> $date = "12/31/07" -as [datetime]
214214
215-
C:\PS>$a -is [DateTime]
215+
C:\PS>$a -is [datetime]
216216
True
217217
218218
PS> 1031 -as [System.Globalization.CultureInfo]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ information about `Update-TypeData`, see [Update-TypeData][01].
215215
Update-TypeData -PrependPath $PSHOME\MyTypes.ps1xml
216216
```
217217

218-
To test the change, run a `Get-ChildItem` command to get the PowerShell.exe
218+
To test the change, run a `Get-ChildItem` command to get the `powershell.exe`
219219
file in the `$PSHOME` directory, and then pipe the file to the `Format-List`
220220
cmdlet to list all of the properties of the file. As a result of the change,
221221
the **Age** property appears in the list.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ Update-Help -Module DhcpServer -SourcePath E:\UsbDrive\SavedHelp
313313
Without parameters, `Save-Help` downloads help for all modules in the session
314314
and for all installed modules that support Updatable Help. To be included,
315315
modules must be installed in directories that are listed in the value of the
316-
`$env:PSModulePath` environment variable, on either the local computer or on a
316+
`$Env:PSModulePath` environment variable, on either the local computer or on a
317317
remote computer for which you want to save help. These are also modules that
318318
are returned by running a `Get-Help -ListAvailable` command.
319319

@@ -330,10 +330,10 @@ However, you can use the **UICulture** parameters of the `Update-Help` and
330330
which they're available.
331331

332332
For example, to save the newest help files for all modules on the session in
333-
Japanese (ja-Jp) and French (fr-FR), type:
333+
Japanese (ja-JP) and French (fr-FR), type:
334334

335335
```powershell
336-
Save-Help -Path \Server\Share -UICulture ja-jp, fr-fr
336+
Save-Help -Path \Server\Share -UICulture ja-JP, fr-FR
337337
```
338338

339339
If help files for the modules aren't available in the languages that you
@@ -411,7 +411,7 @@ only a module name. They don't accept the path to a module file.
411411

412412
Use this technique to update or save help for any module that's not returned by
413413
the **ListAvailable** parameter of the `Get-Module` cmdlet, such as a module
414-
that's installed in a location that's not listed in the `$env:PSModulePath`
414+
that's installed in a location that's not listed in the `$Env:PSModulePath`
415415
environment variable, or a module that's not well-formed (the module directory
416416
doesn't contain at least one file whose basename is the same as the directory
417417
name).

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module. No uncommented statement can precede it, including parameters.
2323

2424
The `using` statement must not contain any variables.
2525

26-
The `using` statement isn't the same as the `using:` scope modifier for
26+
The `using` statement isn't the same as the `Using:` scope modifier for
2727
variables. For more information, see
2828
[about_Remote_Variables](about_Remote_Variables.md).
2929

@@ -91,7 +91,7 @@ A module specification is a hashtable that has the following keys.
9191
- `RequiredVersion` - Specifies an exact, required version of the module.
9292
This can't be used with the other Version keys.
9393

94-
`Import-Module` and the `#requires` statement only import the module functions,
94+
`Import-Module` and the `#Requires` statement only import the module functions,
9595
aliases, and variables, as defined by the module. Classes and enumerations
9696
aren't imported.
9797

@@ -120,7 +120,7 @@ following classes:
120120
- **Deck**
121121
- **Card**
122122

123-
`Import-Module` and the `#requires` statement only import the module functions,
123+
`Import-Module` and the `#Requires` statement only import the module functions,
124124
aliases, and variables, as defined by the module. Classes aren't imported. The
125125
`using module` command imports the module and also loads the class definitions.
126126

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ the dollar sign (`$`). This has the same effect as prefixing the variables name
130130
with the dollar sign (`$`).
131131

132132
```powershell
133-
$variable:HOME
133+
$Variable:HOME
134134
```
135135

136136
### Get variables using wildcards
137137

138-
This command gets the variables with names that begin with "max". You can use
138+
This command gets the variables with names that begin with "Max". You can use
139139
this command from any PowerShell drive.
140140

141141
```powershell
142-
Get-ChildItem -Path Variable:max*
142+
Get-ChildItem -Path Variable:Max*
143143
```
144144

145145
### Get the value of the ? variable
@@ -159,10 +159,12 @@ This command gets the variables that have the values of `ReadOnly` or
159159
`Constant` for their **Options** property.
160160

161161
```powershell
162-
Get-ChildItem -Path Variable: | Where-Object {
163-
$_.options -match "Constant" `
164-
-or $_.options -match "ReadOnly"
165-
} | Format-List -Property name, value, options
162+
Get-ChildItem -Path Variable: |
163+
Where-Object {
164+
$_.Options -match 'Constant' -or
165+
$_.Options -match 'ReadOnly'
166+
} |
167+
Format-List -Property Name, Value, Options
166168
```
167169

168170
## Creating variables
@@ -273,7 +275,7 @@ Get-Help Get-ChildItem
273275
```
274276

275277
```powershell
276-
Get-Help Get-ChildItem -Path variable:
278+
Get-Help Get-ChildItem -Path Variable:
277279
```
278280

279281
## See also

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The next example assigns multiple values to multiple variables.
163163

164164
```powershell
165165
$i,$j,$k = 10, "red", $true # $i is 10, $j is "red", $k is True
166-
$i,$j = 10, "red", $true # $i is 10, $j is [object[]], Length 2
166+
$i,$j = 10, "red", $true # $i is 10, $j is [Object[]], Length 2
167167
```
168168

169169
For more detailed information, see the **Assigning multiple variables** section
@@ -367,7 +367,7 @@ The following command gets the child items in the directory that is represented
367367
by the `ProgramFiles(x86)` environment variable.
368368

369369
```powershell
370-
Get-ChildItem ${env:ProgramFiles(x86)}
370+
Get-ChildItem ${Env:ProgramFiles(x86)}
371371
```
372372

373373
To reference a variable name that includes braces, enclose the variable name in
@@ -400,7 +400,7 @@ global scope, even when it's created in a script or function.
400400
$Global:Computers = "Server01"
401401
```
402402

403-
For any script or command that executes out of session, you need the `Using`
403+
For any script or command that executes out of session, you need the `Using:`
404404
scope modifier to embed variable values from the calling session scope, so that
405405
out of session code can access them.
406406

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ the results of a conditional test.
1717
The `while` statement (also known as a `while` loop) is a language construct
1818
for creating a loop that runs commands in a command block as long as a
1919
conditional test evaluates to true. The `while` statement is easier to
20-
construct than a For statement because its syntax is less complicated. In
21-
addition, it is more flexible than the Foreach statement because you specify a
22-
conditional test in the `while` statement to control how many times the loop
20+
construct than a `for` statement because its syntax is less complicated. In
21+
addition, it is more flexible than the `foreach` statement because you specify
22+
a conditional test in the `while` statement to control how many times the loop
2323
runs.
2424

25-
The following shows the While statement syntax:
25+
The following shows the `while` statement syntax:
2626

2727
```powershell
2828
while (<condition>){<statement list>}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ includes **Interactive**.
8585
Get-Service | Where-Object {$_.ServiceType -like "*Interactive*"}
8686
```
8787

88-
In the following example, the `If` statement includes a condition that uses
88+
In the following example, the `if` statement includes a condition that uses
8989
wildcard characters to find property values. If the restore point's
9090
**Description** includes **PowerShell**, the command adds the value of the
9191
restore point's **CreationTime** property to a log file.
9292

9393
```powershell
9494
$p = Get-ComputerRestorePoint
9595
foreach ($point in $p) {
96-
if ($point.description -like "*PowerShell*") {
96+
if ($point.Description -like "*PowerShell*") {
9797
Add-Content -Path C:\TechDocs\RestoreLog.txt "$($point.CreationTime)"
9898
}
9999
}

reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ Specifies the instance IDs of the disconnected sessions.
518518

519519
The instance ID is a GUID that uniquely identifies a **PSSession** on a local or remote computer.
520520

521-
The instance ID is stored in the **InstanceID** property of the **PSSession**.
521+
The instance ID is stored in the **InstanceId** property of the **PSSession**.
522522

523523
```yaml
524524
Type: System.Guid[]

reference/5.1/Microsoft.PowerShell.Core/Debug-Job.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ command detaches the debugger, and allows the job to continue to run.
5454
This command breaks into a running job with an ID of 3.
5555

5656
```powershell
57-
Debug-Job -ID 3
57+
Debug-Job -Id 3
5858
```
5959

6060
```Output

0 commit comments

Comments
 (0)