Skip to content

Commit f45c517

Browse files
Fix automatic variable case (#11834)
1 parent 1142e36 commit f45c517

File tree

40 files changed

+89
-89
lines changed

40 files changed

+89
-89
lines changed

reference/5.1/Microsoft.PowerShell.Management/Split-Path.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ False
147147
This command changes your location to the folder that contains the PowerShell profile.
148148

149149
```powershell
150-
PS C:\> Set-Location (Split-Path -Path $profile)
150+
PS C:\> Set-Location (Split-Path -Path $PROFILE)
151151
PS C:\Users\User01\Documents\PowerShell>
152152
```
153153

154154
The command in parentheses uses `Split-Path` to return only the parent of the path stored in the
155-
built-in `$Profile` variable. The **Parent** parameter is the default split location parameter.
155+
built-in `$PROFILE` variable. The **Parent** parameter is the default split location parameter.
156156
Therefore, you can omit it from the command. The parentheses direct PowerShell to run the command
157157
first. This is a useful way to move to a folder that has a long path name.
158158

@@ -192,7 +192,7 @@ Accept wildcard characters: False
192192
193193
### -IsAbsolute
194194
195-
Indicates that this cmdlet returns `$True` if the path is absolute and `$false` if it's relative. On
195+
Indicates that this cmdlet returns `$true` if the path is absolute and `$false` if it's relative. On
196196
Windows, an absolute path string must start with a provider drive specifier, like `C:` or `HKCU:`. A
197197
relative path starts with a dot (`.`) or a dot-dot (`..`).
198198

reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ to `Stop-Process`.
102102
The last command gets all of the processes on the computer that were running but that are now
103103
stopped. It uses `Get-Process` to get all of the processes on the computer. The pipeline operator
104104
(`|`) passes the results to the `Where-Object` cmdlet, which selects the ones where the value of the
105-
**HasExited** property is $True. **HasExited** is just one property of process objects. To find all
105+
**HasExited** property is $true. **HasExited** is just one property of process objects. To find all
106106
the properties, type `Get-Process | Get-Member`.
107107

108108
### Example 4: Stop a process not owned by the current user

reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend
8282
This command suspends all of the services on the computer that can be suspended. It uses
8383
`Get-Service` to get objects that represent the services on the computer. The pipeline operator
8484
passes the results to the `Where-Object` cmdlet, which selects only the services that have a value
85-
of `$True` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to
85+
of `$true` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to
8686
`Suspend-Service`. The **Confirm** parameter prompts you for confirmation before suspending each of
8787
the services.
8888

reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ if (Test-Connection -ComputerName Server01 -Quiet) {New-PSSession Server01}
153153

154154
The `if` command uses the `Test-Connection` cmdlet to ping the Server01 computer. The command uses
155155
the **Quiet** parameter, which returns a **Boolean** value, instead of a **Win32_PingStatus**
156-
object. The value is `$True` if any of the four pings succeed and is, otherwise, `$false`.
156+
object. The value is `$true` if any of the four pings succeed and is, otherwise, `$false`.
157157

158-
If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession`
158+
If the `Test-Connection` command returns a value of `$true`, the command uses the `New-PSSession`
159159
cmdlet to create the **PSSession**.
160160

161161
## PARAMETERS
@@ -357,7 +357,7 @@ parameter suppresses all errors.
357357
Each connection that's tested returns a **Boolean** value. If the **ComputerName** parameter
358358
specifies multiple computers, an array of **Boolean** values is returned.
359359

360-
If **any** ping succeeds, `$True` is returned.
360+
If **any** ping succeeds, `$true` is returned.
361361

362362
If **all** pings fail, `$false` is returned.
363363

reference/5.1/Microsoft.PowerShell.Management/Test-Path.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ returns `$false`. Otherwise, it returns `$true`.
7373
### Example 2: Test the path of a profile
7474

7575
```powershell
76-
Test-Path -Path $profile
76+
Test-Path -Path $PROFILE
7777
```
7878

7979
```Output
8080
False
8181
```
8282

8383
```powershell
84-
Test-Path -Path $profile -IsValid
84+
Test-Path -Path $PROFILE -IsValid
8585
```
8686

8787
```Output
@@ -92,7 +92,7 @@ These commands test the path of the PowerShell profile.
9292

9393
The first command determines whether all elements in the path exist. The second command determines
9494
whether the syntax of the path is correct. In this case, the path is `$false`, but the syntax is
95-
correct `$true`. These commands use `$profile`, the automatic variable that points to the location
95+
correct `$true`. These commands use `$PROFILE`, the automatic variable that points to the location
9696
for the profile, even if the profile doesn't exist.
9797

9898
For more information about automatic variables, see
@@ -123,14 +123,14 @@ In this case, because the directory contains only .dwg files, the result is `$fa
123123
### Example 4: Check for a file
124124

125125
```powershell
126-
Test-Path -Path $profile -PathType leaf
126+
Test-Path -Path $PROFILE -PathType leaf
127127
```
128128

129129
```Output
130130
True
131131
```
132132

133-
This command checks whether the path stored in the `$profile` variable leads to a file. In this
133+
This command checks whether the path stored in the `$PROFILE` variable leads to a file. In this
134134
case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true`.
135135

136136
### Example 5: Check paths in the Registry
@@ -169,7 +169,7 @@ file on the computer is newer than `July 13, 2009`.
169169
The NewerThan parameter works only in file system drives.
170170

171171
```powershell
172-
Test-Path $pshome\PowerShell.exe -NewerThan "July 13, 2009"
172+
Test-Path $PSHOME\PowerShell.exe -NewerThan "July 13, 2009"
173173
```
174174

175175
```Output

reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ object.
7575
### Example 3
7676

7777
```powershell
78-
$Credential = $host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName")
78+
$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName")
7979
```
8080

8181
This command uses the **PromptForCredential** method to prompt the user for their user name and

reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This cmdlet is only supported on Windows.
4141
```powershell
4242
New-FileCatalog -Path $PSHOME\Modules\Microsoft.PowerShell.Utility -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -CatalogVersion 2.0
4343
44-
Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\"
44+
Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\"
4545
```
4646

4747
```Output
@@ -51,7 +51,7 @@ Valid
5151
### Example 2: Validate a file catalog with detailed output
5252

5353
```powershell
54-
Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\"
54+
Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\"
5555
```
5656

5757
```Output

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ This example adds the **SizeInMB** script method to a **FileInfo** object that c
144144
size to the nearest MegaByte. The second command creates a **ScriptBlock** that uses the **Round**
145145
static method from the `[math]` type to round the file size to the second decimal place.
146146

147-
The **Value** parameter also uses the `$This` automatic variable, which represents the current
148-
object. The `$This` variable is valid only in script blocks that define new properties and methods.
147+
The **Value** parameter also uses the `$this` automatic variable, which represents the current
148+
object. The `$this` variable is valid only in script blocks that define new properties and methods.
149149

150150
The last command uses dot notation to call the new **SizeInMB** script method on the object in the
151151
`$A` variable.

reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ $ShowWindowAsync = Add-Type @addTypeSplat
216216
217217
# Minimize the PowerShell console
218218
219-
$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $pid).MainWindowHandle, 2)
219+
$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 2)
220220
221221
# Restore the PowerShell console
222222
223-
$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $Pid).MainWindowHandle, 4)
223+
$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 4)
224224
```
225225

226226
The `$Signature` variable stores the C# signature of the `ShowWindowAsync` function. To ensure that

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ shows which input object the output belongs to.
106106
The following examples shows the different output types.
107107

108108
```powershell
109-
$a = $True
109+
$a = $true
110110
Compare-Object -IncludeEqual $a $a
111111
(Compare-Object -IncludeEqual $a $a) | Get-Member
112112
```

0 commit comments

Comments
 (0)