Skip to content

Commit 514b918

Browse files
Fix automatic variable case (#11835)
1 parent f45c517 commit 514b918

40 files changed

+100
-100
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ they have the read-only attribute.
7979

8080
```powershell
8181
Export-Alias -Path "alias.ps1" -As Script
82-
Add-Content -Path $Profile -Value (Get-Content alias.ps1)
82+
Add-Content -Path $PROFILE -Value (Get-Content alias.ps1)
8383
$S = New-PSSession -ComputerName Server01
8484
Invoke-Command -Session $S -FilePath .\alias.ps1
8585
```
@@ -91,7 +91,7 @@ parameter with a value of Script to generate a file that contains a Set-Alias co
9191
alias.
9292

9393
The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile.
94-
The path to the profile is saved in the `$Profile` variable. The command uses the `Get-Content`
94+
The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content`
9595
cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the
9696
profile. For more information, see
9797
[about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md).

reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ In this example, given a credential that you've stored in the `$Credential` vari
8484
> array. This provides some obfuscation but does not provide encryption.
8585
8686
```powershell
87-
$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential
87+
$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential
8888
$Credential | Export-Clixml $Credxmlpath
89-
$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential
89+
$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential
9090
$Credential = Import-Clixml $Credxmlpath
9191
```
9292

reference/5.1/Microsoft.PowerShell.Utility/Format-List.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ default output cmdlet for display.
4848
These commands display information about the PS1XML files in the PowerShell directory as a list.
4949

5050
```powershell
51-
$A = Get-ChildItem $pshome\*.ps1xml
51+
$A = Get-ChildItem $PSHOME\*.ps1xml
5252
Format-List -InputObject $A
5353
```
5454

reference/5.1/Microsoft.PowerShell.Utility/Get-Culture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ This cmdlet returns a **CultureInfo** object representing the current culture.
161161

162162
## NOTES
163163

164-
You can also use the `$PsCulture` and `$PsUICulture` variables. The `$PsCulture` variable stores the
165-
name of the current culture and the `$PsUICulture` variable stores the name of the current UI
164+
You can also use the `$PSCulture` and `$PSUICulture` variables. The `$PSCulture` variable stores the
165+
name of the current culture and the `$PSUICulture` variable stores the name of the current UI
166166
culture.
167167

168168
## RELATED LINKS

reference/5.1/Microsoft.PowerShell.Utility/Get-EventSubscriber.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Id Name State HasMoreData Location Command
111111
```
112112

113113
```powershell
114-
$Timer.Enabled = $True
114+
$Timer.Enabled = $true
115115
$Subscriber = Get-EventSubscriber -SourceIdentifier Timer.Random
116116
($Subscriber.action).gettype().fullname
117117
```

reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ Windows PowerShell includes the following aliases for `Get-Member`:
502502
You can get information about a collection object either using the **InputObject** parameter or by
503503
piping the object, preceded by a comma, to `Get-Member`.
504504

505-
You can use the `$This` automatic variable in script blocks that define the values of new properties
506-
and methods. The `$This` variable refers to the instance of the object to which the properties and
507-
methods are being added. For more information about the `$This` variable, see
505+
You can use the `$this` automatic variable in script blocks that define the values of new properties
506+
and methods. The `$this` variable refers to the instance of the object to which the properties and
507+
methods are being added. For more information about the `$this` variable, see
508508
[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).
509509

510510
If you pass an object representing a _type_, like a type literal such as `[int]`, `Get-Member`

reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ In this example, given a credential that you've stored in the `$Credential` vari
7474
> such as macOS and Linux, credentials are exported in plain text.
7575
7676
```powershell
77-
$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential
77+
$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential
7878
$Credential | Export-Clixml $Credxmlpath
79-
$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential
79+
$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential
8080
$Credential = Import-Clixml $Credxmlpath
8181
```
8282

reference/5.1/Microsoft.PowerShell.Utility/Import-LocalizedData.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Import-LocalizedData -BindingVariable "Messages"
5555
```
5656

5757
If the command is included in the Archives.ps1 script in the `C:\Test` directory, and the value of
58-
the `$PsUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1`
58+
the `$PSUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1`
5959
file in the `C:\test\zh-CN` directory into the `$Messages` variable.
6060

6161
### Example 2: Import localized data strings
@@ -160,13 +160,13 @@ command that converts the contents of the DATA section to a hashtable and stores
160160

161161
The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated
162162
text strings from the TestScript.psd1 file in the subdirectory specified by the value of the
163-
`$PsUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from
163+
`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from
164164
the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the
165165
DATA section logic.
166166

167167
The third command displays the first message in the `$UserMessages` variable.
168168

169-
If the `Import-LocalizedData` command finds a `.psd1` file for the `$PsUICulture` language, the
169+
If the `Import-LocalizedData` command finds a `.psd1` file for the `$PSUICulture` language, the
170170
value of the `$UserMessages` variable contains the translated text strings. If the command fails for
171171
any reason, the command displays the default text strings defined in the DATA section of the script.
172172

@@ -301,14 +301,14 @@ Accept wildcard characters: False
301301

302302
### -UICulture
303303

304-
Specifies an alternate UI culture. The default is the value of the `$PsUICulture` automatic
304+
Specifies an alternate UI culture. The default is the value of the `$PSUICulture` automatic
305305
variable. Enter a UI culture in `<language>-<region>` format, such as `en-US`, `de-DE`, or `ar-SA`.
306306

307307
The value of the **UICulture** parameter determines the language-specific subdirectory (within the
308308
base directory) from which `Import-LocalizedData` gets the `.psd1` file for the script.
309309

310310
The cmdlet searches for a subdirectory with the same name as the value of the **UICulture**
311-
parameter or the `$PsUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the
311+
parameter or the `$PSUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the
312312
directory, or the directory doesn't contain a `.psd1` file for the script, it searches for a
313313
subdirectory with the name of the language code, such as de or ar. If it can't find the subdirectory
314314
or `.psd1` file, the command fails and the data is displayed in the default language specified in
@@ -363,7 +363,7 @@ parameter.
363363

364364
`Import-LocalizedData` begins the search in the directory where the script file is located (or the
365365
value of the **BaseDirectory** parameter). It then searches within the base directory for a
366-
subdirectory with the same name as the value of the `$PsUICulture` variable (or the value of the
366+
subdirectory with the same name as the value of the `$PSUICulture` variable (or the value of the
367367
**UICulture** parameter), such as `de-DE` or `ar-SA`. Then, it searches in that subdirectory for a
368368
`.psd1` file with the same name as the script (or the value of the **FileName** parameter).
369369

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
145145
146146
### System.String
147147
148-
You can pipe a string representing the expression to invoke to this cmdlet. Use the `$Input`
148+
You can pipe a string representing the expression to invoke to this cmdlet. Use the `$input`
149149
automatic variable to represent the input objects in the command.
150150

151151
### System.Management.Automation.PSObject
152152

153-
You can pipe an object representing the expression to invoke to this cmdlet. Use the `$Input`
153+
You can pipe an object representing the expression to invoke to this cmdlet. Use the `$input`
154154
automatic variable to represent the input objects in the command.
155155

156156
## OUTPUTS

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ Major Minor Build Revision
5656

5757
This example creates two instances of the COM object that represents the Internet Explorer
5858
application. The first instance uses the **Property** parameter hash table to call the **Navigate2**
59-
method and set the **Visible** property of the object to `$True` to make the application visible.
59+
method and set the **Visible** property of the object to `$true` to make the application visible.
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.
6666
$IE2 = New-Object -COMObject InternetExplorer.Application`
6767
$IE2.Navigate2("www.microsoft.com")`
68-
$IE2.Visible = $True`
68+
$IE2.Visible = $true`
6969
```
7070

7171
### Example 3: Use the Strict parameter to generate a non-terminating error
@@ -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

0 commit comments

Comments
 (0)