Skip to content

Commit 5360664

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 5360664

40 files changed

+390
-390
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ class BookList {
203203
# Static method to initialize the list of books. Called in the other
204204
# static methods to avoid needing to explicit initialize the value.
205205
static [void] Initialize() { [BookList]::Initialize($false) }
206-
static [bool] Initialize([bool]$force) {
207-
if ([BookList]::Books.Count -gt 0 -and -not $force) {
206+
static [bool] Initialize([bool]$Force) {
207+
if ([BookList]::Books.Count -gt 0 -and -not $Force) {
208208
return $false
209209
}
210210
@@ -527,7 +527,7 @@ module is removed, so are the type accelerators.
527527

528528
## Manually importing classes from a PowerShell module
529529

530-
`Import-Module` and the `#requires` statement only import the module functions,
530+
`Import-Module` and the `#Requires` statement only import the module functions,
531531
aliases, and variables, as defined by the module. Classes aren't imported.
532532

533533
If a module defines classes and enumerations but doesn't add type accelerators

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class BaseExample {
309309
Write-Verbose "[$($Type.Name)] static constructor"
310310
}
311311
312-
static [void] ParamMessage([type]$Type, [object]$Value) {
312+
static [void] ParamMessage([type]$Type, [Object]$Value) {
313313
Write-Verbose "[$($Type.Name)] param constructor ($Value)"
314314
}
315315

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ declaration.
5858
This example shows the basic PowerShell class inheritance syntax.
5959

6060
```powershell
61-
Class Derived : Base {...}
61+
class Derived : Base {...}
6262
```
6363

6464
This example shows inheritance with an interface declaration coming after the
6565
base class.
6666

6767
```powershell
68-
Class Derived : Base, Interface {...}
68+
class Derived : Base, Interface {...}
6969
```
7070

7171
## Syntax
@@ -657,7 +657,7 @@ Kelvin. For any other format, the method should throw a
657657
}
658658
# If format provider isn't specified, use the current culture.
659659
if ($null -eq $FormatProvider) {
660-
$FormatProvider = [CultureInfo]::CurrentCulture
660+
$FormatProvider = [cultureinfo]::CurrentCulture
661661
}
662662
# Format the temperature.
663663
switch ($Format) {
@@ -748,7 +748,7 @@ class Temperature : System.IFormattable {
748748
}
749749
# If format provider isn't specified, use the current culture.
750750
if ($null -eq $FormatProvider) {
751-
$FormatProvider = [CultureInfo]::CurrentCulture
751+
$FormatProvider = [cultureinfo]::CurrentCulture
752752
}
753753
# Format the temperature.
754754
switch ($Format) {
@@ -815,7 +815,7 @@ To implement the interface, the class needs to inherit from
815815
method needs to have the following signature:
816816

817817
```powershell
818-
[bool] Equals([object]$Other) {
818+
[bool] Equals([Object]$Other) {
819819
# Implementation
820820
}
821821
```
@@ -830,7 +830,7 @@ values to Kelvin, since temperatures can be equivalent even with different
830830
scales.
831831

832832
```powershell
833-
[bool] Equals([object]$Other) {
833+
[bool] Equals([Object]$Other) {
834834
# If the other object is null, we can't compare it.
835835
if ($null -eq $Other) {
836836
return $false
@@ -851,7 +851,7 @@ With the interface method implemented, the updated definition for
851851
**Temperature** is:
852852

853853
```powershell
854-
class Temperature : System.IFormattable, System.IEquatable[object] {
854+
class Temperature : System.IFormattable, System.IEquatable[Object] {
855855
[float] $Degrees
856856
[TemperatureScale] $Scale
857857
@@ -899,7 +899,7 @@ class Temperature : System.IFormattable, System.IEquatable[object] {
899899
}
900900
# If format provider isn't specified, use the current culture.
901901
if ($null -eq $FormatProvider) {
902-
$FormatProvider = [CultureInfo]::CurrentCulture
902+
$FormatProvider = [cultureinfo]::CurrentCulture
903903
}
904904
# Format the temperature.
905905
switch ($Format) {
@@ -927,7 +927,7 @@ class Temperature : System.IFormattable, System.IEquatable[object] {
927927
return $this.ToString($null, $null)
928928
}
929929
930-
[bool] Equals([object]$Other) {
930+
[bool] Equals([Object]$Other) {
931931
# If the other object is null, we can't compare it.
932932
if ($null -eq $Other) {
933933
return $false
@@ -999,7 +999,7 @@ converted to a different scale, is a floating point number, the method can rely
999999
on the underlying type for the actual comparison.
10001000

10011001
```powershell
1002-
[int] CompareTo([object]$Other) {
1002+
[int] CompareTo([Object]$Other) {
10031003
# If the other object's null, consider this instance "greater than" it
10041004
if ($null -eq $Other) {
10051005
return 1
@@ -1021,7 +1021,7 @@ The final definition for the **Temperature** class is:
10211021
```powershell
10221022
class Temperature : System.IFormattable,
10231023
System.IComparable,
1024-
System.IEquatable[object] {
1024+
System.IEquatable[Object] {
10251025
# Instance properties
10261026
[float] $Degrees
10271027
[TemperatureScale] $Scale
@@ -1071,7 +1071,7 @@ class Temperature : System.IFormattable,
10711071
}
10721072
# If format provider isn't specified, use the current culture.
10731073
if ($null -eq $FormatProvider) {
1074-
$FormatProvider = [CultureInfo]::CurrentCulture
1074+
$FormatProvider = [cultureinfo]::CurrentCulture
10751075
}
10761076
# Format the temperature.
10771077
switch ($Format) {
@@ -1099,7 +1099,7 @@ class Temperature : System.IFormattable,
10991099
return $this.ToString($null, $null)
11001100
}
11011101
1102-
[bool] Equals([object]$Other) {
1102+
[bool] Equals([Object]$Other) {
11031103
# If the other object is null, we can't compare it.
11041104
if ($null -eq $Other) {
11051105
return $false
@@ -1112,7 +1112,7 @@ class Temperature : System.IFormattable,
11121112
# Compare the temperatures as Kelvin.
11131113
return $this.ToKelvin() -eq $OtherTemperature.ToKelvin()
11141114
}
1115-
[int] CompareTo([object]$Other) {
1115+
[int] CompareTo([Object]$Other) {
11161116
# If the other object's null, consider this instance "greater than" it
11171117
if ($null -eq $Other) {
11181118
return 1
@@ -1182,7 +1182,7 @@ generic type as long as the type parameter is already defined at parse time.
11821182
```powershell
11831183
class ExampleStringList : System.Collections.Generic.List[string] {}
11841184
1185-
$List = [ExampleStringList]::New()
1185+
$List = [ExampleStringList]::new()
11861186
$List.AddRange([string[]]@('a','b','c'))
11871187
$List.GetType() | Format-List -Property Name, BaseType
11881188
$List
@@ -1243,7 +1243,7 @@ This time, PowerShell doesn't raise any errors. Both classes are now defined.
12431243
Run the following code block to view the behavior of the new class.
12441244

12451245
```powershell
1246-
$List = [ExampleItemList]::New()
1246+
$List = [ExampleItemList]::new()
12471247
$List.AddRange([ExampleItem[]]@(
12481248
[ExampleItem]@{ Name = 'Foo' }
12491249
[ExampleItem]@{ Name = 'Bar' }

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -602,17 +602,17 @@ class. The representation for **DerivedClassB** is different because it
602602
overrode the `ToString()` instance method.
603603

604604
```powershell
605-
"`$base = [BaseClass]::New() => $($base = [BaseClass]::New(); $base)"
606-
"`$a = [DerivedClassA]::New() => $($a = [DerivedClassA]::New(); $a)"
607-
"`$b = [DerivedClassB]::New() => $($b = [DerivedClassB]::New(); $b)"
608-
"`$c = [DerivedClassC]::New() => $($c = [DerivedClassC]::New(); $c)"
605+
"`$base = [BaseClass]::new() => $($base = [BaseClass]::new(); $base)"
606+
"`$a = [DerivedClassA]::new() => $($a = [DerivedClassA]::new(); $a)"
607+
"`$b = [DerivedClassB]::new() => $($b = [DerivedClassB]::new(); $b)"
608+
"`$c = [DerivedClassC]::new() => $($c = [DerivedClassC]::new(); $c)"
609609
```
610610

611611
```Output
612-
$base = [BaseClass]::New() => 11/6/2023 9:44:57 AM
613-
$a = [DerivedClassA]::New() => 11/6/2023 9:44:57 AM
614-
$b = [DerivedClassB]::New() => 2023-11-06
615-
$c = [DerivedClassC]::New() => 11/6/2023 9:44:57 AM
612+
$base = [BaseClass]::new() => 11/6/2023 9:44:57 AM
613+
$a = [DerivedClassA]::new() => 11/6/2023 9:44:57 AM
614+
$b = [DerivedClassB]::new() => 2023-11-06
615+
$c = [DerivedClassC]::new() => 11/6/2023 9:44:57 AM
616616
```
617617

618618
The next block calls the `SetTimeStamp()` instance method for each instance,

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ C:\TechDocs\FindDocs.ps1
3838
You can run any executable command using its full path. As a security feature,
3939
PowerShell doesn't run executable commands, including PowerShell scripts and
4040
native commands, unless the command is located in a path listed in the
41-
`$env:Path` environment variable.
41+
`$Env:PATH` environment variable.
4242

4343
To run an executable file that's in the current directory, specify the full
4444
path or use the relative path `.\` to represent the current directory.
@@ -58,7 +58,7 @@ when it runs commands.
5858
1. External executable files (including PowerShell script files)
5959

6060
Therefore, if you type `help`, PowerShell first looks for an alias named
61-
`help`, then a function named `Help`, and finally a cmdlet named `Help`. It
61+
`help`, then a function named `help`, and finally a cmdlet named `help`. It
6262
runs the first `help` item that it finds.
6363

6464
For example, if your session contains a cmdlet and a function, both named
@@ -247,7 +247,7 @@ For example, the following command saves the `Map` function in the `$myMap`
247247
variable and then uses the `Call` operator to run it.
248248

249249
```powershell
250-
$myMap = (Get-Command -Name map -CommandType function)
250+
$myMap = (Get-Command -Name map -CommandType Function)
251251
& ($myMap)
252252
```
253253

@@ -273,7 +273,7 @@ first module found alphabetically.
273273

274274
If the cmdlet isn't loaded, PowerShell searches the installed modules and
275275
autoloads the first module that contains the cmdlet and runs that cmdlet.
276-
PowerShell searches for modules in each path defined in the `$env:PSModulePath`
276+
PowerShell searches for modules in each path defined in the `$Env:PSModulePath`
277277
environment variable. The paths are searched in the order that they're listed
278278
in the variable. Within each path, the modules are searched in alphabetical
279279
order. PowerShell uses the cmdlet from the first match it finds.
@@ -299,7 +299,7 @@ Import-Module -Name DateFunctions -Prefix ZZ
299299

300300
## Running external executables
301301

302-
On Windows. PowerShell treats the file extensions listed in the `$env:PATHEXT`
302+
On Windows. PowerShell treats the file extensions listed in the `$Env:PATHEXT`
303303
environment variable as executable files. Files that aren't Windows executables
304304
are handed to Windows to process. Windows looks up the file association and
305305
executes the default Windows Shell verb for the extension. For Windows to
@@ -312,7 +312,7 @@ to register the file handler. For more information, see the documentation for
312312
the [ftype][04] command.
313313

314314
For PowerShell to see a file extension as executable in the current session,
315-
you must add the extension to the `$env:PATHEXT` environment variable.
315+
you must add the extension to the `$Env:PATHEXT` environment variable.
316316

317317
## See also
318318

0 commit comments

Comments
 (0)