diff --git a/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md index d18302ddff98..b44949f3e3c9 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md @@ -147,12 +147,12 @@ False This command changes your location to the folder that contains the PowerShell profile. ```powershell -PS C:\> Set-Location (Split-Path -Path $profile) +PS C:\> Set-Location (Split-Path -Path $PROFILE) PS C:\Users\User01\Documents\PowerShell> ``` The command in parentheses uses `Split-Path` to return only the parent of the path stored in the -built-in `$Profile` variable. The **Parent** parameter is the default split location parameter. +built-in `$PROFILE` variable. The **Parent** parameter is the default split location parameter. Therefore, you can omit it from the command. The parentheses direct PowerShell to run the command first. This is a useful way to move to a folder that has a long path name. @@ -192,7 +192,7 @@ Accept wildcard characters: False ### -IsAbsolute -Indicates that this cmdlet returns `$True` if the path is absolute and `$false` if it's relative. On +Indicates that this cmdlet returns `$true` if the path is absolute and `$false` if it's relative. On Windows, an absolute path string must start with a provider drive specifier, like `C:` or `HKCU:`. A relative path starts with a dot (`.`) or a dot-dot (`..`). diff --git a/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md index 029db6208e0b..0e6c89403b35 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md @@ -102,7 +102,7 @@ to `Stop-Process`. The last command gets all of the processes on the computer that were running but that are now stopped. It uses `Get-Process` to get all of the processes on the computer. The pipeline operator (`|`) passes the results to the `Where-Object` cmdlet, which selects the ones where the value of the -**HasExited** property is $True. **HasExited** is just one property of process objects. To find all +**HasExited** property is $true. **HasExited** is just one property of process objects. To find all the properties, type `Get-Process | Get-Member`. ### Example 4: Stop a process not owned by the current user diff --git a/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md index 658f20de0774..64b9d9f31c0a 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md @@ -82,7 +82,7 @@ PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend This command suspends all of the services on the computer that can be suspended. It uses `Get-Service` to get objects that represent the services on the computer. The pipeline operator passes the results to the `Where-Object` cmdlet, which selects only the services that have a value -of `$True` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to +of `$true` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to `Suspend-Service`. The **Confirm** parameter prompts you for confirmation before suspending each of the services. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md b/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md index bda00f0b8d60..2f4d836a5be2 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md @@ -153,9 +153,9 @@ if (Test-Connection -ComputerName Server01 -Quiet) {New-PSSession Server01} The `if` command uses the `Test-Connection` cmdlet to ping the Server01 computer. The command uses the **Quiet** parameter, which returns a **Boolean** value, instead of a **Win32_PingStatus** -object. The value is `$True` if any of the four pings succeed and is, otherwise, `$false`. +object. The value is `$true` if any of the four pings succeed and is, otherwise, `$false`. -If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` +If the `Test-Connection` command returns a value of `$true`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. ## PARAMETERS @@ -357,7 +357,7 @@ parameter suppresses all errors. Each connection that's tested returns a **Boolean** value. If the **ComputerName** parameter specifies multiple computers, an array of **Boolean** values is returned. -If **any** ping succeeds, `$True` is returned. +If **any** ping succeeds, `$true` is returned. If **all** pings fail, `$false` is returned. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md index b16b7f72ddce..773fd85506a9 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md @@ -73,7 +73,7 @@ returns `$false`. Otherwise, it returns `$true`. ### Example 2: Test the path of a profile ```powershell -Test-Path -Path $profile +Test-Path -Path $PROFILE ``` ```Output @@ -81,7 +81,7 @@ False ``` ```powershell -Test-Path -Path $profile -IsValid +Test-Path -Path $PROFILE -IsValid ``` ```Output @@ -92,7 +92,7 @@ These commands test the path of the PowerShell profile. The first command determines whether all elements in the path exist. The second command determines whether the syntax of the path is correct. In this case, the path is `$false`, but the syntax is -correct `$true`. These commands use `$profile`, the automatic variable that points to the location +correct `$true`. These commands use `$PROFILE`, the automatic variable that points to the location for the profile, even if the profile doesn't exist. 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 ### Example 4: Check for a file ```powershell -Test-Path -Path $profile -PathType leaf +Test-Path -Path $PROFILE -PathType leaf ``` ```Output True ``` -This command checks whether the path stored in the `$profile` variable leads to a file. In this +This command checks whether the path stored in the `$PROFILE` variable leads to a file. In this case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true`. ### Example 5: Check paths in the Registry @@ -169,7 +169,7 @@ file on the computer is newer than `July 13, 2009`. The NewerThan parameter works only in file system drives. ```powershell -Test-Path $pshome\PowerShell.exe -NewerThan "July 13, 2009" +Test-Path $PSHOME\PowerShell.exe -NewerThan "July 13, 2009" ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md b/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md index 0503e160d9ea..633a4449f1d8 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md @@ -75,7 +75,7 @@ object. ### Example 3 ```powershell -$Credential = $host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") +$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` This command uses the **PromptForCredential** method to prompt the user for their user name and diff --git a/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md index 30f63ede5daa..e1729fe342fa 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -41,7 +41,7 @@ This cmdlet is only supported on Windows. ```powershell New-FileCatalog -Path $PSHOME\Modules\Microsoft.PowerShell.Utility -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -CatalogVersion 2.0 -Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\" +Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\" ``` ```Output @@ -51,7 +51,7 @@ Valid ### Example 2: Validate a file catalog with detailed output ```powershell -Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\" +Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\" ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md b/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md index 359f39320a8c..38e836c710cd 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md @@ -144,8 +144,8 @@ This example adds the **SizeInMB** script method to a **FileInfo** object that c size to the nearest MegaByte. The second command creates a **ScriptBlock** that uses the **Round** static method from the `[math]` type to round the file size to the second decimal place. -The **Value** parameter also uses the `$This` automatic variable, which represents the current -object. The `$This` variable is valid only in script blocks that define new properties and methods. +The **Value** parameter also uses the `$this` automatic variable, which represents the current +object. The `$this` variable is valid only in script blocks that define new properties and methods. The last command uses dot notation to call the new **SizeInMB** script method on the object in the `$A` variable. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md b/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md index 3fd79b0a7d52..8a5ad59a88c4 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md @@ -216,11 +216,11 @@ $ShowWindowAsync = Add-Type @addTypeSplat # Minimize the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $pid).MainWindowHandle, 2) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 2) # Restore the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $Pid).MainWindowHandle, 4) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 4) ``` The `$Signature` variable stores the C# signature of the `ShowWindowAsync` function. To ensure that diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Compare-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Compare-Object.md index 1a398e94951f..4acfbe5e0828 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Compare-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Compare-Object.md @@ -106,7 +106,7 @@ shows which input object the output belongs to. The following examples shows the different output types. ```powershell -$a = $True +$a = $true Compare-Object -IncludeEqual $a $a (Compare-Object -IncludeEqual $a $a) | Get-Member ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md index 1056e342349b..7e9f1773ce47 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md @@ -161,12 +161,12 @@ False This command changes your location to the folder that contains the PowerShell profile. ```powershell -PS C:\> Set-Location (Split-Path -Path $profile) +PS C:\> Set-Location (Split-Path -Path $PROFILE) PS C:\Users\User01\Documents\PowerShell> ``` The command in parentheses uses `Split-Path` to return only the parent of the path stored in the -built-in `$Profile` variable. The **Parent** parameter is the default split location parameter. +built-in `$PROFILE` variable. The **Parent** parameter is the default split location parameter. Therefore, you can omit it from the command. The parentheses direct PowerShell to run the command first. This is a useful way to move to a folder that has a long path name. @@ -225,7 +225,7 @@ Accept wildcard characters: False ### -IsAbsolute -Indicates that this cmdlet returns `$True` if the path is absolute and `$false` if it's relative. On +Indicates that this cmdlet returns `$true` if the path is absolute and `$false` if it's relative. On Windows, an absolute path string must start with a provider drive specifier, like `C:` or `HKCU:`. A relative path starts with a dot (`.`) or a dot-dot (`..`). diff --git a/reference/7.4/Microsoft.PowerShell.Management/Stop-Process.md b/reference/7.4/Microsoft.PowerShell.Management/Stop-Process.md index 1b5c1e48522f..2a14d6cad819 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Stop-Process.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Stop-Process.md @@ -102,7 +102,7 @@ to `Stop-Process`. The last command gets all of the processes on the computer that were running but that are now stopped. It uses `Get-Process` to get all of the processes on the computer. The pipeline operator (`|`) passes the results to the `Where-Object` cmdlet, which selects the ones where the value of the -**HasExited** property is $True. **HasExited** is just one property of process objects. To find all +**HasExited** property is $true. **HasExited** is just one property of process objects. To find all the properties, type `Get-Process | Get-Member`. ### Example 4: Stop a process not owned by the current user diff --git a/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md index 3a4b780f9fc6..9e6c9d5686d4 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Suspend-Service.md @@ -84,7 +84,7 @@ PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend This command suspends all of the services on the computer that can be suspended. It uses `Get-Service` to get objects that represent the services on the computer. The pipeline operator passes the results to the `Where-Object` cmdlet, which selects only the services that have a value -of `$True` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to +of `$true` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to `Suspend-Service`. The **Confirm** parameter prompts you for confirmation before suspending each of the services. diff --git a/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md b/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md index 95e989ca8f40..92f2e8946eda 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md @@ -146,10 +146,10 @@ if (Test-Connection -TargetName Server01 -Quiet) { New-PSSession -ComputerName S ``` The `Test-Connection` cmdlet pings the `Server01` computer, with the **Quiet** parameter provided. -The resulting value is `$True` if any of the four pings succeed. If none of the pings succeed, +The resulting value is `$true` if any of the four pings succeed. If none of the pings succeed, the value is `$false`. -If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` +If the `Test-Connection` command returns a value of `$true`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. ### Example 6: Use the Traceroute parameter @@ -404,7 +404,7 @@ errors. Each connection that's tested returns a **Boolean** value. If the **TargetName** parameter specifies multiple computers, an array of **Boolean** values is returned. -If **any** ping to a given target succeeds, `$True` is returned. +If **any** ping to a given target succeeds, `$true` is returned. If **all** pings to a given target fail, `$false` is returned. @@ -500,7 +500,7 @@ Specifies the TCP port number on the target to be used in the TCP connection tes The cmdlet attempts to make a TCP connection to the specified port on the target. -- The cmdlet returns `$True` if a connection is made. +- The cmdlet returns `$true` if a connection is made. - The cmdlet returns `$false` if a connection is not made. ```yaml diff --git a/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md index 5984eb6b82a4..5c24f55b78a0 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md @@ -71,7 +71,7 @@ returns `$false`. Otherwise, it returns `$true`. ### Example 2: Test the path of a profile ```powershell -Test-Path -Path $profile +Test-Path -Path $PROFILE ``` ```Output @@ -79,7 +79,7 @@ False ``` ```powershell -Test-Path -Path $profile -IsValid +Test-Path -Path $PROFILE -IsValid ``` ```Output @@ -90,7 +90,7 @@ These commands test the path of the PowerShell profile. The first command determines whether all elements in the path exist. The second command determines whether the syntax of the path is correct. In this case, the path is `$false`, but the syntax is -correct `$true`. These commands use `$profile`, the automatic variable that points to the location +correct `$true`. These commands use `$PROFILE`, the automatic variable that points to the location for the profile, even if the profile doesn't exist. For more information about automatic variables, see @@ -121,14 +121,14 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $profile -PathType leaf +Test-Path -Path $PROFILE -PathType leaf ``` ```Output True ``` -This command checks whether the path stored in the `$profile` variable leads to a file. In this +This command checks whether the path stored in the `$PROFILE` variable leads to a file. In this case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true`. ### Example 5: Check paths in the Registry @@ -167,7 +167,7 @@ the computer is newer than `July 13, 2009`. The NewerThan parameter works only in file system drives. ```powershell -Test-Path $pshome\pwsh.exe -NewerThan "July 13, 2009" +Test-Path $PSHOME\pwsh.exe -NewerThan "July 13, 2009" ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md index c90a5236cf2b..6e897be8074d 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md @@ -73,7 +73,7 @@ object. ### Example 3 ```powershell -$Credential = $host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") +$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` This command uses the **PromptForCredential** method to prompt the user for their user name and diff --git a/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md index 8ee1682d496a..ae270c4d906d 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -43,7 +43,7 @@ This cmdlet is only supported on Windows. ```powershell New-FileCatalog -Path $PSHOME\Modules\Microsoft.PowerShell.Utility -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -CatalogVersion 2.0 -Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\" +Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\" ``` ```Output @@ -53,7 +53,7 @@ Valid ### Example 2: Validate a file catalog with detailed output ```powershell -Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\" +Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\" ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Add-Member.md b/reference/7.4/Microsoft.PowerShell.Utility/Add-Member.md index 0b85331f071f..0168d1e55f50 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Add-Member.md @@ -144,8 +144,8 @@ This example adds the **SizeInMB** script method to a **FileInfo** object that c size to the nearest MegaByte. The second command creates a **ScriptBlock** that uses the **Round** static method from the `[math]` type to round the file size to the second decimal place. -The **Value** parameter also uses the `$This` automatic variable, which represents the current -object. The `$This` variable is valid only in script blocks that define new properties and methods. +The **Value** parameter also uses the `$this` automatic variable, which represents the current +object. The `$this` variable is valid only in script blocks that define new properties and methods. The last command uses dot notation to call the new **SizeInMB** script method on the object in the `$A` variable. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md b/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md index 406eb724c637..61fb62728eb3 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md @@ -223,11 +223,11 @@ $ShowWindowAsync = Add-Type @addTypeSplat # Minimize the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $pid).MainWindowHandle, 2) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 2) # Restore the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $Pid).MainWindowHandle, 4) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 4) ``` The `$Signature` variable stores the C# signature of the `ShowWindowAsync` function. To ensure that diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Compare-Object.md b/reference/7.4/Microsoft.PowerShell.Utility/Compare-Object.md index 9650f4b4f231..406742a8bc46 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Compare-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Compare-Object.md @@ -107,7 +107,7 @@ shows which input object the output belongs to. The following examples shows the different output types. ```powershell -$a = $True +$a = $true Compare-Object -IncludeEqual $a $a (Compare-Object -IncludeEqual $a $a) | Get-Member ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md index d7818fdd940c..6c9f6356a6b8 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md @@ -161,12 +161,12 @@ False This command changes your location to the folder that contains the PowerShell profile. ```powershell -PS C:\> Set-Location (Split-Path -Path $profile) +PS C:\> Set-Location (Split-Path -Path $PROFILE) PS C:\Users\User01\Documents\PowerShell> ``` The command in parentheses uses `Split-Path` to return only the parent of the path stored in the -built-in `$Profile` variable. The **Parent** parameter is the default split location parameter. +built-in `$PROFILE` variable. The **Parent** parameter is the default split location parameter. Therefore, you can omit it from the command. The parentheses direct PowerShell to run the command first. This is a useful way to move to a folder that has a long path name. @@ -225,7 +225,7 @@ Accept wildcard characters: False ### -IsAbsolute -Indicates that this cmdlet returns `$True` if the path is absolute and `$false` if it's relative. On +Indicates that this cmdlet returns `$true` if the path is absolute and `$false` if it's relative. On Windows, an absolute path string must start with a provider drive specifier, like `C:` or `HKCU:`. A relative path starts with a dot (`.`) or a dot-dot (`..`). diff --git a/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md index c8b8e099cc3e..43a92ce527f5 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md @@ -103,7 +103,7 @@ to `Stop-Process`. The last command gets all of the processes on the computer that were running but that are now stopped. It uses `Get-Process` to get all of the processes on the computer. The pipeline operator (`|`) passes the results to the `Where-Object` cmdlet, which selects the ones where the value of the -**HasExited** property is $True. **HasExited** is just one property of process objects. To find all +**HasExited** property is $true. **HasExited** is just one property of process objects. To find all the properties, type `Get-Process | Get-Member`. ### Example 4: Stop a process not owned by the current user diff --git a/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md index cc6999f30027..5b0e5e5882a7 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md @@ -86,7 +86,7 @@ Get-Service | This command suspends all of the services on the computer that can be suspended. It uses `Get-Service` to get objects that represent the services on the computer. The pipeline operator passes the results to the `Where-Object` cmdlet, which selects only the services that have a value -of `$True` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to +of `$true` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to `Suspend-Service`. The **Confirm** parameter prompts you for confirmation before suspending each of the services. diff --git a/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md b/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md index e6f66e86f24c..b9a19897f029 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md @@ -146,10 +146,10 @@ if (Test-Connection -TargetName Server01 -Quiet) { New-PSSession -ComputerName S ``` The `Test-Connection` cmdlet pings the `Server01` computer, with the **Quiet** parameter provided. -The resulting value is `$True` if any of the four pings succeed. If none of the pings succeed, +The resulting value is `$true` if any of the four pings succeed. If none of the pings succeed, the value is `$false`. -If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` +If the `Test-Connection` command returns a value of `$true`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. ### Example 6: Use the Traceroute parameter @@ -404,7 +404,7 @@ errors. Each connection that's tested returns a **Boolean** value. If the **TargetName** parameter specifies multiple computers, an array of **Boolean** values is returned. -If **any** ping to a given target succeeds, `$True` is returned. +If **any** ping to a given target succeeds, `$true` is returned. If **all** pings to a given target fail, `$false` is returned. @@ -500,7 +500,7 @@ Specifies the TCP port number on the target to be used in the TCP connection tes The cmdlet attempts to make a TCP connection to the specified port on the target. -- The cmdlet returns `$True` if a connection is made. +- The cmdlet returns `$true` if a connection is made. - The cmdlet returns `$false` if a connection is not made. ```yaml diff --git a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md index de7d0aa2abb7..f07d83c962a5 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md @@ -71,7 +71,7 @@ returns `$false`. Otherwise, it returns `$true`. ### Example 2: Test the path of a profile ```powershell -Test-Path -Path $profile +Test-Path -Path $PROFILE ``` ```Output @@ -79,7 +79,7 @@ False ``` ```powershell -Test-Path -Path $profile -IsValid +Test-Path -Path $PROFILE -IsValid ``` ```Output @@ -90,7 +90,7 @@ These commands test the path of the PowerShell profile. The first command determines whether all elements in the path exist. The second command determines whether the syntax of the path is correct. In this case, the path is `$false`, but the syntax is -correct `$true`. These commands use `$profile`, the automatic variable that points to the location +correct `$true`. These commands use `$PROFILE`, the automatic variable that points to the location for the profile, even if the profile doesn't exist. For more information about automatic variables, see @@ -121,14 +121,14 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $profile -PathType leaf +Test-Path -Path $PROFILE -PathType leaf ``` ```Output True ``` -This command checks whether the path stored in the `$profile` variable leads to a file. In this +This command checks whether the path stored in the `$PROFILE` variable leads to a file. In this case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true`. ### Example 5: Check paths in the Registry diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md index 2745c9f1be0e..1b3d8d961272 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md @@ -73,7 +73,7 @@ object. ### Example 3 ```powershell -$Credential = $host.ui.PromptForCredential( +$Credential = $Host.ui.PromptForCredential( "Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` diff --git a/reference/7.5/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/7.5/Microsoft.PowerShell.Security/Test-FileCatalog.md index 799bad8a6a4b..6c7c51ea0386 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -50,7 +50,7 @@ New-FileCatalog @NewFileCatalogParams $TestFileCatalogParams = @{ CatalogFilePath = "\temp\Microsoft.PowerShell.Utility.cat" - Path = "$PSHome\Modules\Microsoft.PowerShell.Utility\" + Path = "$PSHOME\Modules\Microsoft.PowerShell.Utility\" } Test-FileCatalog @TestFileCatalogParams ``` @@ -65,7 +65,7 @@ Valid $TestFileCatalogParams = @{ Detailed = $true CatalogFilePath = "\temp\Microsoft.PowerShell.Utility.cat" - Path = "$PSHome\Modules\Microsoft.PowerShell.Utility\" + Path = "$PSHOME\Modules\Microsoft.PowerShell.Utility\" } Test-FileCatalog @TestFileCatalogParams ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Add-Member.md b/reference/7.5/Microsoft.PowerShell.Utility/Add-Member.md index 5793cc031270..37c817680b9e 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Add-Member.md @@ -144,8 +144,8 @@ This example adds the **SizeInMB** script method to a **FileInfo** object that c size to the nearest MegaByte. The second command creates a **ScriptBlock** that uses the **Round** static method from the `[math]` type to round the file size to the second decimal place. -The **Value** parameter also uses the `$This` automatic variable, which represents the current -object. The `$This` variable is valid only in script blocks that define new properties and methods. +The **Value** parameter also uses the `$this` automatic variable, which represents the current +object. The `$this` variable is valid only in script blocks that define new properties and methods. The last command uses dot notation to call the new **SizeInMB** script method on the object in the `$A` variable. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Add-Type.md b/reference/7.5/Microsoft.PowerShell.Utility/Add-Type.md index 2d14a4018a85..50b5863fd4ff 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Add-Type.md @@ -224,11 +224,11 @@ $ShowWindowAsync = Add-Type @addTypeSplat # Minimize the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $pid).MainWindowHandle, 2) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 2) # Restore the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $Pid).MainWindowHandle, 4) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 4) ``` The `$Signature` variable stores the C# signature of the `ShowWindowAsync` function. To ensure that diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Compare-Object.md b/reference/7.5/Microsoft.PowerShell.Utility/Compare-Object.md index 47a787422d06..67029be1c49e 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Compare-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Compare-Object.md @@ -111,7 +111,7 @@ shows which input object the output belongs to. The following examples shows the different output types. ```powershell -$a = $True +$a = $true Compare-Object -IncludeEqual $a $a (Compare-Object -IncludeEqual $a $a) | Get-Member ``` diff --git a/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md index 21c8eb1767b1..3c92b221bc6f 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md @@ -161,12 +161,12 @@ False This command changes your location to the folder that contains the PowerShell profile. ```powershell -PS C:\> Set-Location (Split-Path -Path $profile) +PS C:\> Set-Location (Split-Path -Path $PROFILE) PS C:\Users\User01\Documents\PowerShell> ``` The command in parentheses uses `Split-Path` to return only the parent of the path stored in the -built-in `$Profile` variable. The **Parent** parameter is the default split location parameter. +built-in `$PROFILE` variable. The **Parent** parameter is the default split location parameter. Therefore, you can omit it from the command. The parentheses direct PowerShell to run the command first. This is a useful way to move to a folder that has a long path name. @@ -225,7 +225,7 @@ Accept wildcard characters: False ### -IsAbsolute -Indicates that this cmdlet returns `$True` if the path is absolute and `$false` if it's relative. On +Indicates that this cmdlet returns `$true` if the path is absolute and `$false` if it's relative. On Windows, an absolute path string must start with a provider drive specifier, like `C:` or `HKCU:`. A relative path starts with a dot (`.`) or a dot-dot (`..`). diff --git a/reference/7.6/Microsoft.PowerShell.Management/Stop-Process.md b/reference/7.6/Microsoft.PowerShell.Management/Stop-Process.md index dbe0fa148102..83f892940348 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Stop-Process.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Stop-Process.md @@ -102,7 +102,7 @@ to `Stop-Process`. The last command gets all of the processes on the computer that were running but that are now stopped. It uses `Get-Process` to get all of the processes on the computer. The pipeline operator (`|`) passes the results to the `Where-Object` cmdlet, which selects the ones where the value of the -**HasExited** property is $True. **HasExited** is just one property of process objects. To find all +**HasExited** property is $true. **HasExited** is just one property of process objects. To find all the properties, type `Get-Process | Get-Member`. ### Example 4: Stop a process not owned by the current user diff --git a/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md index 76436cebb80b..b70c24403a73 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Suspend-Service.md @@ -84,7 +84,7 @@ PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend This command suspends all of the services on the computer that can be suspended. It uses `Get-Service` to get objects that represent the services on the computer. The pipeline operator passes the results to the `Where-Object` cmdlet, which selects only the services that have a value -of `$True` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to +of `$true` for the **CanPauseAndContinue** property. Another pipeline operator passes the results to `Suspend-Service`. The **Confirm** parameter prompts you for confirmation before suspending each of the services. diff --git a/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md b/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md index 01a12141b46d..316160eed6a3 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md @@ -146,10 +146,10 @@ if (Test-Connection -TargetName Server01 -Quiet) { New-PSSession -ComputerName S ``` The `Test-Connection` cmdlet pings the `Server01` computer, with the **Quiet** parameter provided. -The resulting value is `$True` if any of the four pings succeed. If none of the pings succeed, +The resulting value is `$true` if any of the four pings succeed. If none of the pings succeed, the value is `$false`. -If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` +If the `Test-Connection` command returns a value of `$true`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. ### Example 6: Use the Traceroute parameter @@ -404,7 +404,7 @@ errors. Each connection that's tested returns a **Boolean** value. If the **TargetName** parameter specifies multiple computers, an array of **Boolean** values is returned. -If **any** ping to a given target succeeds, `$True` is returned. +If **any** ping to a given target succeeds, `$true` is returned. If **all** pings to a given target fail, `$false` is returned. @@ -500,7 +500,7 @@ Specifies the TCP port number on the target to be used in the TCP connection tes The cmdlet attempts to make a TCP connection to the specified port on the target. -- The cmdlet returns `$True` if a connection is made. +- The cmdlet returns `$true` if a connection is made. - The cmdlet returns `$false` if a connection is not made. ```yaml diff --git a/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md index 55131fb2b04f..5c9ae8583082 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md @@ -71,7 +71,7 @@ returns `$false`. Otherwise, it returns `$true`. ### Example 2: Test the path of a profile ```powershell -Test-Path -Path $profile +Test-Path -Path $PROFILE ``` ```Output @@ -79,7 +79,7 @@ False ``` ```powershell -Test-Path -Path $profile -IsValid +Test-Path -Path $PROFILE -IsValid ``` ```Output @@ -90,7 +90,7 @@ These commands test the path of the PowerShell profile. The first command determines whether all elements in the path exist. The second command determines whether the syntax of the path is correct. In this case, the path is `$false`, but the syntax is -correct `$true`. These commands use `$profile`, the automatic variable that points to the location +correct `$true`. These commands use `$PROFILE`, the automatic variable that points to the location for the profile, even if the profile doesn't exist. For more information about automatic variables, see @@ -121,14 +121,14 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $profile -PathType leaf +Test-Path -Path $PROFILE -PathType leaf ``` ```Output True ``` -This command checks whether the path stored in the `$profile` variable leads to a file. In this +This command checks whether the path stored in the `$PROFILE` variable leads to a file. In this case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true`. ### Example 5: Check paths in the Registry diff --git a/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md index 391f7e0c75b3..0744b35b114e 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md @@ -73,7 +73,7 @@ object. ### Example 3 ```powershell -$Credential = $host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") +$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` This command uses the **PromptForCredential** method to prompt the user for their user name and diff --git a/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md index 3f5b6a29015f..92b0c6cea5a0 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -43,7 +43,7 @@ This cmdlet is only supported on Windows. ```powershell New-FileCatalog -Path $PSHOME\Modules\Microsoft.PowerShell.Utility -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -CatalogVersion 2.0 -Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\" +Test-FileCatalog -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\" ``` ```Output @@ -53,7 +53,7 @@ Valid ### Example 2: Validate a file catalog with detailed output ```powershell -Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHome\Modules\Microsoft.PowerShell.Utility\" +Test-FileCatalog -Detailed -CatalogFilePath \temp\Microsoft.PowerShell.Utility.cat -Path "$PSHOME\Modules\Microsoft.PowerShell.Utility\" ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Add-Member.md b/reference/7.6/Microsoft.PowerShell.Utility/Add-Member.md index f76b6b65ee03..e3c8076c40df 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Add-Member.md @@ -144,8 +144,8 @@ This example adds the **SizeInMB** script method to a **FileInfo** object that c size to the nearest MegaByte. The second command creates a **ScriptBlock** that uses the **Round** static method from the `[math]` type to round the file size to the second decimal place. -The **Value** parameter also uses the `$This` automatic variable, which represents the current -object. The `$This` variable is valid only in script blocks that define new properties and methods. +The **Value** parameter also uses the `$this` automatic variable, which represents the current +object. The `$this` variable is valid only in script blocks that define new properties and methods. The last command uses dot notation to call the new **SizeInMB** script method on the object in the `$A` variable. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md b/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md index 9a92c1776444..c76df4275832 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md @@ -223,11 +223,11 @@ $ShowWindowAsync = Add-Type @addTypeSplat # Minimize the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $pid).MainWindowHandle, 2) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 2) # Restore the PowerShell console -$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $Pid).MainWindowHandle, 4) +$ShowWindowAsync::ShowWindowAsync((Get-Process -Id $PID).MainWindowHandle, 4) ``` The `$Signature` variable stores the C# signature of the `ShowWindowAsync` function. To ensure that diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Compare-Object.md b/reference/7.6/Microsoft.PowerShell.Utility/Compare-Object.md index 8a8fc3e9f318..39223b3a88c2 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Compare-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Compare-Object.md @@ -107,7 +107,7 @@ shows which input object the output belongs to. The following examples shows the different output types. ```powershell -$a = $True +$a = $true Compare-Object -IncludeEqual $a $a (Compare-Object -IncludeEqual $a $a) | Get-Member ```