From d5a2d907d2d8f556363c1e4a5be30b47f5b3e1fa Mon Sep 17 00:00:00 2001
From: surfingoldelephant
<151538956+surfingoldelephant@users.noreply.github.com>
Date: Mon, 24 Feb 2025 18:27:34 +0000
Subject: [PATCH] Fix automatic variable case
---
.../cmdlet/extending-output-objects.md | 4 ++--
.../format/powershell-formatting-files.md | 2 +-
.../developer/hosting/host04-sample.md | 4 ++--
.../developer/hosting/host05-sample.md | 4 ++--
.../developer/hosting/host06-sample.md | 4 ++--
...ow-to-write-a-powershell-module-manifest.md | 2 +-
.../module/installing-a-powershell-module.md | 2 +-
reference/docs-conceptual/how-to-use-docs.md | 2 +-
.../docs-conceptual/lang-spec/chapter-04.md | 2 +-
.../docs-conceptual/lang-spec/chapter-07.md | 16 ++++++++--------
.../docs-conceptual/lang-spec/chapter-08.md | 6 +++---
.../docs-conceptual/lang-spec/chapter-12.md | 6 +++---
.../deep-dives/everything-about-arrays.md | 2 +-
.../deep-dives/everything-about-hashtable.md | 4 ++--
.../deep-dives/everything-about-switch.md | 10 +++++-----
...eating-.NET-and-COM-Objects--New-Object-.md | 4 ++--
...owerShell-Command-from-a-Running-Process.md | 2 +-
.../samples/Working-with-Registry-Entries.md | 6 +++---
.../security/preventing-script-injection.md | 18 +++++++++---------
.../remoting/powershell-remoting-faq.yml | 8 ++++----
.../whats-new/What-s-New-in-PowerShell-74.md | 2 +-
.../whats-new/What-s-New-in-PowerShell-75.md | 4 ++--
...-Debug-Scripts-in-Windows-PowerShell-ISE.md | 4 ++--
.../The-ISEFileCollection-Object.md | 2 +-
.../The-ISESnippetCollection-Object.md | 2 +-
tests/Pester/Update-Help.Tests.ps1 | 16 ++++++++--------
26 files changed, 69 insertions(+), 69 deletions(-)
diff --git a/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md b/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md
index 86ac1e3fe5ed..0027a132878a 100644
--- a/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md
+++ b/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md
@@ -6,7 +6,7 @@ title: Extending Output Objects
---
# Extending Output Objects
-You can extend the .NET Framework objects that are returned by cmdlets, functions, and scripts by using types files (.ps1xml). Types files are XML-based files that let you add properties and methods to existing objects. For example, Windows PowerShell provides the Types.ps1xml file, which adds elements to several existing .NET Framework objects. The Types.ps1xml file is located in the Windows PowerShell installation directory (`$pshome`). You can create your own types file to further extend those objects or to extend other objects. When you extend an object by using a types file, any instance of the object is extended with the new elements.
+You can extend the .NET Framework objects that are returned by cmdlets, functions, and scripts by using types files (.ps1xml). Types files are XML-based files that let you add properties and methods to existing objects. For example, Windows PowerShell provides the Types.ps1xml file, which adds elements to several existing .NET Framework objects. The Types.ps1xml file is located in the Windows PowerShell installation directory (`$PSHOME`). You can create your own types file to further extend those objects or to extend other objects. When you extend an object by using a types file, any instance of the object is extended with the new elements.
## Extending the System.Array Object
@@ -66,7 +66,7 @@ PS> (1, 2, 3, 4).Length
## Custom Types Files
-To create a custom types file, start by copying an existing types file. The new file can have any name, but it must have a .ps1xml file name extension. When you copy the file, you can place the new file in any directory that is accessible to Windows PowerShell, but it is useful to place the files in the Windows PowerShell installation directory (`$pshome`) or in a subdirectory of the installation directory.
+To create a custom types file, start by copying an existing types file. The new file can have any name, but it must have a .ps1xml file name extension. When you copy the file, you can place the new file in any directory that is accessible to Windows PowerShell, but it is useful to place the files in the Windows PowerShell installation directory (`$PSHOME`) or in a subdirectory of the installation directory.
To add your own extended types to the file, add a types element for each object that you want to extend. The following topics provide examples.
diff --git a/reference/docs-conceptual/developer/format/powershell-formatting-files.md b/reference/docs-conceptual/developer/format/powershell-formatting-files.md
index 633708696ff9..ca395b3f8fd0 100644
--- a/reference/docs-conceptual/developer/format/powershell-formatting-files.md
+++ b/reference/docs-conceptual/developer/format/powershell-formatting-files.md
@@ -7,7 +7,7 @@ title: Windows PowerShell Formatting Files
# Windows PowerShell Formatting Files
Windows PowerShell provides several formatting files (.format.ps1xml) that are located in the
-installation directory (`$pshome`). Each of these files defines the default display for a specific
+installation directory (`$PSHOME`). Each of these files defines the default display for a specific
set of .NET objects. These files should never be changed. However, you can use them as a reference
for creating your own custom formatting files.
diff --git a/reference/docs-conceptual/developer/hosting/host04-sample.md b/reference/docs-conceptual/developer/hosting/host04-sample.md
index 04f4b827e699..651b174bd100 100644
--- a/reference/docs-conceptual/developer/hosting/host04-sample.md
+++ b/reference/docs-conceptual/developer/hosting/host04-sample.md
@@ -27,7 +27,7 @@ This sample requires Windows PowerShell 2.0.
- Building a console application that uses these host classes to build an interactive Windows
PowerShell shell.
-- Creating a `$profile` variable and loading the following profiles.
+- Creating a `$PROFILE` variable and loading the following profiles.
- current user, current host
- current user, all hosts
@@ -145,7 +145,7 @@ namespace Microsoft.Samples.PowerShell.Host
this.myRunSpace.Open();
// Create a PowerShell object that will be used to execute the commands
- // to create $profile and load the profiles.
+ // to create $PROFILE and load the profiles.
lock (this.instanceLock)
{
this.currentPowerShell = PowerShell.Create();
diff --git a/reference/docs-conceptual/developer/hosting/host05-sample.md b/reference/docs-conceptual/developer/hosting/host05-sample.md
index 2dcfe7b49405..7387f75a9c6a 100644
--- a/reference/docs-conceptual/developer/hosting/host05-sample.md
+++ b/reference/docs-conceptual/developer/hosting/host05-sample.md
@@ -30,7 +30,7 @@ host application also supports calls to remote computers by using the
- Building a console application that uses these host classes to build an interactive Windows PowerShell shell.
-- Creating a `$profile` variable and loading the following profiles.
+- Creating a `$PROFILE` variable and loading the following profiles.
- current user, current host
- current user, all hosts
@@ -159,7 +159,7 @@ namespace Microsoft.Samples.PowerShell.Host
this.myRunSpace.Open();
// Create a PowerShell object to run the commands used to create
- // $profile and load the profiles.
+ // $PROFILE and load the profiles.
lock (this.instanceLock)
{
this.currentPowerShell = PowerShell.Create();
diff --git a/reference/docs-conceptual/developer/hosting/host06-sample.md b/reference/docs-conceptual/developer/hosting/host06-sample.md
index d7a5501a8340..1b53bf7767c2 100644
--- a/reference/docs-conceptual/developer/hosting/host06-sample.md
+++ b/reference/docs-conceptual/developer/hosting/host06-sample.md
@@ -29,7 +29,7 @@ the user.
- Building a console application that uses these host classes to build an interactive Windows
PowerShell shell.
-- Creating a `$profile` variable and loading the following profiles.
+- Creating a `$PROFILE` variable and loading the following profiles.
- current user, current host
- current user, all hosts
@@ -165,7 +165,7 @@ namespace Microsoft.Samples.PowerShell.Host
this.myRunSpace.Open();
// Create a PowerShell object to run the commands used to create
- // $profile and load the profiles.
+ // $PROFILE and load the profiles.
lock (this.instanceLock)
{
this.currentPowerShell = PowerShell.Create();
diff --git a/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md b/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md
index 997b983d8f24..f21ecc650bc5 100644
--- a/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md
+++ b/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md
@@ -93,7 +93,7 @@ The following table describes the elements you can include in a module manifest.
| **Copyright**
Type: `String` | `'(c)
Example: `Copyright = '2019 AuthorName. All rights reserved.'` |
| **Description**
Type: `String` | `
Example: `Description = 'This is the module's description.'` |
| **PowerShellVersion**
Type: `Version` | `
Example: `PowerShellVersion = '5.0'` |
-| **PowerShellHostName**
Type: `String` | `
Example: `PowerShellHostName = 'ConsoleHost'` |
+| **PowerShellHostName**
Type: `String` | `
Example: `PowerShellHostName = 'ConsoleHost'` |
| **PowerShellHostVersion**
Type: `Version` | `
Example: `PowerShellHostVersion = '2.0'` |
| **DotNetFrameworkVersion**
Type: `Version` | `
Example: `DotNetFrameworkVersion = '3.5'` |
| **CLRVersion**
Type: `Version` | `
Example: `CLRVersion = '3.5'` |
diff --git a/reference/docs-conceptual/developer/module/installing-a-powershell-module.md b/reference/docs-conceptual/developer/module/installing-a-powershell-module.md
index eff2532be081..48da1b5da3d6 100644
--- a/reference/docs-conceptual/developer/module/installing-a-powershell-module.md
+++ b/reference/docs-conceptual/developer/module/installing-a-powershell-module.md
@@ -33,7 +33,7 @@ PowerShell modules. Cmdlets rely on the value of this environment variable to fi
By default, the **PSModulePath** environment variable value contains the following system and user
module directories, but you can add to and edit the value.
-- `$PSHome\Modules` (`%Windir%\System32\WindowsPowerShell\v1.0\Modules`)
+- `$PSHOME\Modules` (`%Windir%\System32\WindowsPowerShell\v1.0\Modules`)
> [!WARNING]
> This location is reserved for modules that ship with Windows. Do not install modules to this
diff --git a/reference/docs-conceptual/how-to-use-docs.md b/reference/docs-conceptual/how-to-use-docs.md
index 66eb44c204cb..86f44cfa2d00 100644
--- a/reference/docs-conceptual/how-to-use-docs.md
+++ b/reference/docs-conceptual/how-to-use-docs.md
@@ -48,7 +48,7 @@ If there are version-specific differences, the documentation makes note of those
![Animation showing how to use the version selector.][04]
-You can verify the version of PowerShell you are using by inspecting the `$PSversionTable.PSVersion`
+You can verify the version of PowerShell you are using by inspecting the `$PSVersionTable.PSVersion`
value. The following example shows the output for Windows PowerShell 5.1.
```powershell
diff --git a/reference/docs-conceptual/lang-spec/chapter-04.md b/reference/docs-conceptual/lang-spec/chapter-04.md
index 3991ecc3f294..977631b0e7c6 100644
--- a/reference/docs-conceptual/lang-spec/chapter-04.md
+++ b/reference/docs-conceptual/lang-spec/chapter-04.md
@@ -929,7 +929,7 @@ In PowerShell, this type is `System.Management.Automation.PSCustomObject`. The c
### 4.5.14 Command description type
-The automatic variable `$PsCmdlet` is an object that represents the cmdlet or function being
+The automatic variable `$PSCmdlet` is an object that represents the cmdlet or function being
executed. The type of this object is implementation defined; it has the following accessible
members:
diff --git a/reference/docs-conceptual/lang-spec/chapter-07.md b/reference/docs-conceptual/lang-spec/chapter-07.md
index 41a8dd230aeb..296b0998a84c 100644
--- a/reference/docs-conceptual/lang-spec/chapter-07.md
+++ b/reference/docs-conceptual/lang-spec/chapter-07.md
@@ -1698,10 +1698,10 @@ dash:
Description:
If the left operand does not designate a collection, the result has type `bool` and if that result
-is `$true`, the elements of the Hashtable `$matches` are set to the strings that match (or
+is `$true`, the elements of the Hashtable `$Matches` are set to the strings that match (or
do-not-match) the value designated by the right operand. Otherwise, the result is a possibly empty
unconstrained 1-dimensional array containing the elements of the collection that test True when
-compared to the value designated by the right operand, and `$matches` is not set. The right operand
+compared to the value designated by the right operand, and `$Matches` is not set. The right operand
may designate a string that contains regular expressions ([§3.16][§3.16]), in which case, it is
referred to as a _pattern_. These operators have two variants ([§7.8][§7.8]).
@@ -1710,11 +1710,11 @@ These operators support submatches ([§7.8.4.6][§7.8.4.6]).
Examples:
```powershell
-"Hello" -match ".l" # True, $matches key/value is 0/"el"
-"Hello" -match '\^h.*o$' # True, $matches key/value is
+"Hello" -match ".l" # True, $Matches key/value is 0/"el"
+"Hello" -match '\^h.*o$' # True, $Matches key/value is
0/"Hello"
-"Hello" -cmatch '\^h.*o$' # False, $matches not set
-"abc\^ef" -match ".\\\^e" # True, $matches key/value is 0/"c\^e"
+"Hello" -cmatch '\^h.*o$' # False, $Matches not set
+"abc\^ef" -match ".\\\^e" # True, $Matches key/value is 0/"c\^e"
"abc" -notmatch "[A-Za-z]" # False
"abc" -match "[\^A-Za-z]" # False
@@ -1885,7 +1885,7 @@ _submatches_) delimited by parentheses. Consider the following example:
`"red" -match "red"`
-The result is `$true` and key 0 of `$matches` contains "red", that part of the string designated by
+The result is `$true` and key 0 of `$Matches` contains "red", that part of the string designated by
the left operand that exactly matched the pattern designated by the right operand.
In the following example, the whole pattern is a submatch:
@@ -1914,7 +1914,7 @@ In the case of `-replace`, the replacement text can access the submatches via na
The resulting string is "the morning of Monday".
-Instead of having keys in `$matches` be zero-based indexes, submatches can be named using the form
+Instead of having keys in `$Matches` be zero-based indexes, submatches can be named using the form
`?<*name*>`. For example, `"((r)e)(d)"` can be written with three named submatches, `m1`, `m2`, and
`m3`, as follows: `"(?
ParameterSetName = "Computer")]
[Parameter(ParameterSetName = "User")]
[int] $SharedParam = 5 )
if ($PsCmdlet.ParameterSetName -eq "Computer")
+
if ($PSCmdlet.ParameterSetName -eq "Computer")
{
# handle "Computer" parameter set
}
elseif ($PsCmdlet.ParameterSetName -eq "User")
+
elseif ($PSCmdlet.ParameterSetName -eq "User")
{
# handle "User" parameter set
}
diff --git a/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md b/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md
index c1036cb8a72d..302b926ab45c 100644
--- a/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md
+++ b/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md
@@ -764,7 +764,7 @@ We can take the same approach with `Select-String`.
$servers | Select-String SQL
```
-I take a closer look at `Select-String`,`-match` and the `$matches` variable in another post called
+I take a closer look at `Select-String`,`-match` and the `$Matches` variable in another post called
[The many ways to use regex][10].
### $null or empty
diff --git a/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md b/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md
index afedbcccb808..6b14315f0e11 100644
--- a/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md
+++ b/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md
@@ -912,7 +912,7 @@ $PSDefaultParameterValues["Out-File:Encoding"] = "UTF8"
This adds an entry to the `$PSDefaultParameterValues` hashtable that sets `UTF8` as the default
value for the `Out-File -Encoding` parameter. This is session-specific so you should place it in
-your `$profile`.
+your `$PROFILE`.
I use this often to pre-assign values that I type quite often.
@@ -932,7 +932,7 @@ For a more in-depth breakdown, see this great article on [Automatic Defaults][Au
## Regex $Matches
-When you use the `-match` operator, an automatic variable called `$matches` is created with the
+When you use the `-match` operator, an automatic variable called `$Matches` is created with the
results of the match. If you have any sub expressions in your regex, those sub matches are also
listed.
diff --git a/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md b/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md
index b3b10ce22749..205b744b5330 100644
--- a/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md
+++ b/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md
@@ -558,10 +558,10 @@ switch ( $age )
It still executes the same way and gives a better visual break when quickly looking at it.
-### Regex $matches
+### Regex $Matches
We need to revisit regex to touch on something that isn't immediately obvious. The use of regex
-populates the `$matches` variable. I do go into the use of `$matches` more when I talk about
+populates the `$Matches` variable. I do go into the use of `$Matches` more when I talk about
[The many ways to use regex][The many ways to use regex]. Here is a quick sample to show it in
action with named matches.
@@ -572,15 +572,15 @@ switch -Regex ($message)
{
'(?