diff --git a/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index ea6b3f3a2c86..24494ddc6ff7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -60,7 +60,7 @@ local computer. Use the **Name** parameter to identify the session configuration that you want to change. Use the other parameters to specify new values for the properties of the session configuration. To delete a property value from the configuration, and use the default value, enter an empty string (`""`) or a -value of `$Null` for the corresponding parameter. +value of `$null` for the corresponding parameter. Starting in PowerShell 3.0, you can use a session configuration file to define a session configuration. This feature provides a simple and discoverable method for setting and changing the @@ -104,7 +104,7 @@ The third command removes the `AdminConfig.ps1` script from the configuration. ```powershell Register-PSSessionConfiguration -Name "AdminShell" -AssemblyName "C:\Shells\AdminShell.dll" -ConfigurationTypeName "AdminClass" Set-PSSessionConfiguration -Name "AdminShell" -StartupScript "AdminConfig.ps1" -Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $Null +Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $null ``` ### Example 3: Display results @@ -490,7 +490,7 @@ use a session configuration in a session, users must have at least `Execute(Invo the configuration. To use the default security descriptor for the configuration, enter an empty string (`""`) or a -value of `$Null`. The default is the root SDDL in the `WSMan:` drive. +value of `$null`. The default is the root SDDL in the `WSMan:` drive. If the security descriptor is complex, consider using the **ShowSecurityDescriptorUI** parameter instead of this one. You cannot use both parameters in the same command. @@ -562,7 +562,7 @@ Specifies the startup script for the configuration. Enter the fully qualified pa script. The specified script runs in the new session that uses the session configuration. To delete a startup script from a session configuration, enter an empty string (`""`) or a value of -`$Null`. +`$null`. You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command diff --git a/reference/5.1/Microsoft.PowerShell.Core/Set-StrictMode.md b/reference/5.1/Microsoft.PowerShell.Core/Set-StrictMode.md index 4a3b4e70d101..bbd4a2a89a19 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Set-StrictMode.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Set-StrictMode.md @@ -40,10 +40,10 @@ override the setting inherited from the global scope. When `Set-StrictMode` is off, PowerShell has the following behaviors: -- Uninitialized variables are assumed to have a value of `0` (zero) or `$Null`, depending on type -- References to non-existent properties return `$Null` +- Uninitialized variables are assumed to have a value of `0` (zero) or `$null`, depending on type +- References to non-existent properties return `$null` - Results of improper function syntax vary with the error conditions -- Attempting to retrieve a value using an invalid index in an array returns `$Null` +- Attempting to retrieve a value using an invalid index in an array returns `$null` ## EXAMPLES @@ -151,7 +151,7 @@ which nothing is added. With version `2.0` strict mode, it's correctly interpret syntax for submitting two values. Without version `2.0`, the reference to the non-existent **Month** property of a string returns only -`$Null`. With version `2.0`, it's interpreted correctly as a reference error. +`$null`. With version `2.0`, it's interpreted correctly as a reference error. ### Example 3: Turn on strict mode as version 3.0 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 420cba51cdfd..9d3d4dd22783 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -36,7 +36,7 @@ cmdlet also generates an error for each missing file. ### Example 1: Test a manifest ```powershell -Test-ModuleManifest -Path "$pshome\Modules\TestModule.psd1" +Test-ModuleManifest -Path "$PSHOME\Modules\TestModule.psd1" ``` This command tests the `TestModule.psd1` module manifest. @@ -44,14 +44,14 @@ This command tests the `TestModule.psd1` module manifest. ### Example 2: Test a manifest by using the pipeline ```powershell -"$pshome\Modules\TestModule.psd1" | test-modulemanifest +"$PSHOME\Modules\TestModule.psd1" | test-modulemanifest ``` ```Output Test-ModuleManifest : The specified type data file 'C:\Windows\System32\Wi ndowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml' could not be processed because the file was not found. Please correct the path and try again. At line:1 char:34 -+ "$pshome\Modules\TestModule.psd1" | test-modulemanifest <<<< ++ "$PSHOME\Modules\TestModule.psd1" | test-modulemanifest <<<< + CategoryInfo : ResourceUnavailable: (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml:String) [Test-ModuleManifest], FileNotFoundException + FullyQualifiedErrorId : Modules_TypeDataFileNotFound,Microsoft.PowerShell.Commands.TestModuleManifestCommandName @@ -87,7 +87,7 @@ function Test-ManifestBool ($path) ``` This function is like `Test-ModuleManifest`, but it returns a Boolean value. The function returns -`$True` if the manifest passed the test and `$false` otherwise. +`$true` if the manifest passed the test and `$false` otherwise. The function uses the Get-ChildItem cmdlet, alias = dir, to get the module manifest specified by the `$path` variable. The command uses a pipeline operator (`|`) to pass the file object to @@ -99,7 +99,7 @@ object that `Test-ModuleManifest` returns in the $a variable. Therefore, the obj displayed. Then, in a separate command, the function displays the value of the `$?` automatic variable. If the -previous command generates no error, the command displays `$True`, and `$false` otherwise. +previous command generates no error, the command displays `$true`, and `$false` otherwise. You can use this function in conditional statements, such as those that might precede an `Import-Module` command or a command that uses the module. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md b/reference/5.1/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md index 21df1ae3e5f2..c932ee7778eb 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md @@ -23,7 +23,7 @@ Test-PSSessionConfigurationFile [-Path] [] This cmdlet verifies that a session configuration file contains valid keys and the values are of the correct type. For enumerated values, the cmdlet verifies that the specified values are valid. -The cmdlet returns `$True` if the file passes all tests and `$false` if it does not. To find any +The cmdlet returns `$true` if the file passes all tests and `$false` if it does not. To find any errors, use the **Verbose** parameter. `Test-PSSessionConfigurationFile` verifies the session configuration files, such as those created by diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index a883886c4127..7452728cc2e0 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -357,7 +357,7 @@ Get-Command | Where-Object { $_.OutputType } ```powershell # Use Where-Object to get objects that are containers. This gets objects that -# have the **PSIsContainer** property with a value of $True and excludes all +# have the **PSIsContainer** property with a value of $true and excludes all # others. Get-ChildItem | Where-Object PSIsContainer Get-ChildItem | Where-Object { $_.PSIsContainer } diff --git a/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md index 525bf0482099..a79d02a274e5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md @@ -131,7 +131,7 @@ The steps to create a read-only file are included in the example. ```powershell New-Item -Path .\IsReadOnlyTextFile.txt -ItemType File -Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $True +Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $true Get-ChildItem -Path .\IsReadOnlyTextFile.txt Add-Content -Path .\IsReadOnlyTextFile.txt -Value 'Add value to read-only text file' -Force Get-Content -Path .\IsReadOnlyTextFile.txt diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md index ada3a4de2d44..517f58dd290a 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md @@ -121,7 +121,7 @@ cmdlet, then to the `Format-Table` cmdlet, which formats the processes by using view. The **Priority** view, and other views, are defined in the PS1XML format files in the PowerShell -home directory (`$pshome`). +home directory (`$PSHOME`). ### Example 5: Add a property to the standard Get-Process output display diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-Item.md b/reference/5.1/Microsoft.PowerShell.Management/New-Item.md index b7158f486b23..425c60d39da5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-Item.md @@ -95,13 +95,13 @@ New-Item -Path "c:\" -Name "logfiles" -ItemType "directory" ### Example 3: Create a profile -This command creates a PowerShell profile in the path that is specified by the `$profile` variable. +This command creates a PowerShell profile in the path that is specified by the `$PROFILE` variable. -You can use profiles to customize PowerShell. `$profile` is an automatic (built-in) variable that +You can use profiles to customize PowerShell. `$PROFILE` is an automatic (built-in) variable that stores the path and file name of the "CurrentUser/CurrentHost" profile. By default, the profile does not exist, even though PowerShell stores a path and file name for it. -In this command, the `$profile` variable represents the path of the file. **ItemType** parameter +In this command, the `$PROFILE` variable represents the path of the file. **ItemType** parameter specifies that the command creates a file. The **Force** parameter lets you create a file in the profile path, even when the directories in the path do not exist. @@ -112,7 +112,7 @@ For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Co and [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). ```powershell -New-Item -Path $profile -ItemType "file" -Force +New-Item -Path $PROFILE -ItemType "file" -Force ``` > [!NOTE] diff --git a/reference/5.1/Microsoft.PowerShell.Management/Pop-Location.md b/reference/5.1/Microsoft.PowerShell.Management/Pop-Location.md index fee78f5551af..43bb694cbe53 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Pop-Location.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Pop-Location.md @@ -199,7 +199,7 @@ If you make a named location stack the current location stack, you can no longer `Push-Location` or `Pop-Location` cmdlets to add or get items from the default stack or use the `Get-Location` cmdlet to display the locations in the unnamed stack. To make the unnamed stack the current stack, use the **StackName** parameter of the `Set-Location` cmdlet with a value of -`$Null` or an empty string (`""`). +`$null` or an empty string (`""`). `Pop-Location` is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PSProvider`. For more information, see diff --git a/reference/5.1/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/5.1/Microsoft.PowerShell.Management/Set-ItemProperty.md index 561447b151d5..2aa29fdc2ff5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -84,7 +84,7 @@ Set-ItemProperty -LiteralPath -InputObject [-PassThru] [-F The `Set-ItemProperty` cmdlet changes the value of the property of the specified item. You can use the cmdlet to establish or change the properties of items. For example, you can use `Set-ItemProperty` to set the value of the **IsReadOnly** property of a -file object to `$True`. +file object to `$true`. You also use `Set-ItemProperty` to create and change registry values and data. For example, you can add a new registry entry to a key and establish or change its value. @@ -170,7 +170,7 @@ Th example uses `Get-ChildItem` to get the `weekly.txt` file. The file object is specify the property and its new value. ```powershell -Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $True +Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $true ``` ## PARAMETERS diff --git a/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index eede989fb757..8a7df73a0b26 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -62,7 +62,7 @@ local computer. Use the **Name** parameter to identify the session configuration that you want to change. Use the other parameters to specify new values for the properties of the session configuration. To delete a property value from the configuration, and use the default value, enter an empty string (`""`) or a -value of `$Null` for the corresponding parameter. +value of `$null` for the corresponding parameter. Starting in PowerShell 3.0, you can use a session configuration file to define a session configuration. This feature provides a simple and discoverable method for setting and changing the @@ -97,7 +97,7 @@ The third command removes the `AdminConfig.ps1` script from the configuration. ```powershell Register-PSSessionConfiguration -Name "AdminShell" -AssemblyName "C:\Shells\AdminShell.dll" -ConfigurationTypeName "AdminClass" Set-PSSessionConfiguration -Name "AdminShell" -StartupScript "AdminConfig.ps1" -Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $Null +Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $null ``` ### Example 2: Display results @@ -483,7 +483,7 @@ use a session configuration in a session, users must have at least `Execute(Invo the configuration. To use the default security descriptor for the configuration, enter an empty string (`""`) or a -value of `$Null`. The default is the root SDDL in the `WSMan:` drive. +value of `$null`. The default is the root SDDL in the `WSMan:` drive. If the security descriptor is complex, consider using the **ShowSecurityDescriptorUI** parameter instead of this one. You cannot use both parameters in the same command. @@ -555,7 +555,7 @@ Specifies the startup script for the configuration. Enter the fully qualified pa script. The specified script runs in the new session that uses the session configuration. To delete a startup script from a session configuration, enter an empty string (`""`) or a value of -`$Null`. +`$null`. You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command diff --git a/reference/7.4/Microsoft.PowerShell.Core/Set-StrictMode.md b/reference/7.4/Microsoft.PowerShell.Core/Set-StrictMode.md index 01ba59e095e4..c264f2d5e14d 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Set-StrictMode.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Set-StrictMode.md @@ -40,10 +40,10 @@ override the setting inherited from the global scope. When `Set-StrictMode` is off, PowerShell has the following behaviors: -- Uninitialized variables are assumed to have a value of `0` (zero) or `$Null`, depending on type -- References to non-existent properties return `$Null` +- Uninitialized variables are assumed to have a value of `0` (zero) or `$null`, depending on type +- References to non-existent properties return `$null` - Results of improper function syntax vary with the error conditions -- Attempting to retrieve a value using an invalid index in an array returns `$Null` +- Attempting to retrieve a value using an invalid index in an array returns `$null` ## EXAMPLES @@ -137,7 +137,7 @@ which nothing is added. With version `2.0` strict mode, it's correctly interpret syntax for submitting two values. Without version `2.0`, the reference to the non-existent **Month** property of a string returns only -`$Null`. With version `2.0`, it's interpreted correctly as a reference error. +`$null`. With version `2.0`, it's interpreted correctly as a reference error. ### Example 3: Turn on strict mode as version 3.0 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md index cd9cfe1a51ee..48094f7c1fa7 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -36,7 +36,7 @@ cmdlet also generates an error for each missing file. ### Example 1: Test a manifest ```powershell -Test-ModuleManifest -Path "$pshome\Modules\TestModule.psd1" +Test-ModuleManifest -Path "$PSHOME\Modules\TestModule.psd1" ``` This command tests the `TestModule.psd1` module manifest. @@ -44,14 +44,14 @@ This command tests the `TestModule.psd1` module manifest. ### Example 2: Test a manifest by using the pipeline ```powershell -"$pshome\Modules\TestModule.psd1" | test-modulemanifest +"$PSHOME\Modules\TestModule.psd1" | test-modulemanifest ``` ```Output Test-ModuleManifest : The specified type data file 'C:\Windows\System32\Wi ndowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml' could not be processed because the file was not found. Please correct the path and try again. At line:1 char:34 -+ "$pshome\Modules\TestModule.psd1" | test-modulemanifest <<<< ++ "$PSHOME\Modules\TestModule.psd1" | test-modulemanifest <<<< + CategoryInfo : ResourceUnavailable: (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml:String) [Test-ModuleManifest], FileNotFoundException + FullyQualifiedErrorId : Modules_TypeDataFileNotFound,Microsoft.PowerShell.Commands.TestModuleManifestCommandName @@ -87,7 +87,7 @@ function Test-ManifestBool ($path) ``` This function is like `Test-ModuleManifest`, but it returns a Boolean value. The function returns -`$True` if the manifest passed the test and `$false` otherwise. +`$true` if the manifest passed the test and `$false` otherwise. The function uses the Get-ChildItem cmdlet, alias = dir, to get the module manifest specified by the `$path` variable. The command uses a pipeline operator (`|`) to pass the file object to @@ -99,7 +99,7 @@ object that `Test-ModuleManifest` returns in the $a variable. Therefore, the obj displayed. Then, in a separate command, the function displays the value of the `$?` automatic variable. If the -previous command generates no error, the command displays `$True`, and `$false` otherwise. +previous command generates no error, the command displays `$true`, and `$false` otherwise. You can use this function in conditional statements, such as those that might precede an `Import-Module` command or a command that uses the module. diff --git a/reference/7.4/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md b/reference/7.4/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md index 26557136de08..f97f4fb378bb 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md @@ -25,7 +25,7 @@ Test-PSSessionConfigurationFile [-Path] [] This cmdlet verifies that a session configuration file contains valid keys and the values are of the correct type. For enumerated values, the cmdlet verifies that the specified values are valid. -The cmdlet returns `$True` if the file passes all tests and `$false` if it does not. To find any +The cmdlet returns `$true` if the file passes all tests and `$false` if it does not. To find any errors, use the **Verbose** parameter. `Test-PSSessionConfigurationFile` verifies the session configuration files, such as those created by diff --git a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md index ef4851491182..34bc9d605362 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md @@ -364,7 +364,7 @@ Get-Command | Where-Object { $_.OutputType } ```powershell # Use Where-Object to get objects that are containers. This gets objects that -# have the **PSIsContainer** property with a value of $True and excludes all +# have the **PSIsContainer** property with a value of $true and excludes all # others. Get-ChildItem | Where-Object PSIsContainer Get-ChildItem | Where-Object { $_.PSIsContainer } diff --git a/reference/7.4/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.4/Microsoft.PowerShell.Management/Add-Content.md index 0704020c3c27..c5055822b3ad 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Add-Content.md @@ -131,7 +131,7 @@ The steps to create a read-only file are included in the example. ```powershell New-Item -Path .\IsReadOnlyTextFile.txt -ItemType File -Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $True +Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $true Get-ChildItem -Path .\IsReadOnlyTextFile.txt Add-Content -Path .\IsReadOnlyTextFile.txt -Value 'Add value to read-only text file' -Force Get-Content -Path .\IsReadOnlyTextFile.txt diff --git a/reference/7.4/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.4/Microsoft.PowerShell.Management/Get-Process.md index 91d73a4f8a3d..f1c2570efe2f 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Get-Process.md @@ -118,7 +118,7 @@ cmdlet, then to the `Format-Table` cmdlet, which formats the processes by using view. The **Priority** view, and other views, are defined in the PS1XML format files in the PowerShell -home directory (`$pshome`). +home directory (`$PSHOME`). ### Example 5: Add a property to the standard Get-Process output display diff --git a/reference/7.4/Microsoft.PowerShell.Management/New-Item.md b/reference/7.4/Microsoft.PowerShell.Management/New-Item.md index 701b6c4f51d4..1b8dac0d02ff 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/New-Item.md @@ -95,13 +95,13 @@ New-Item -Path "c:\" -Name "logfiles" -ItemType "directory" ### Example 3: Create a profile -This command creates a PowerShell profile in the path that is specified by the `$profile` variable. +This command creates a PowerShell profile in the path that is specified by the `$PROFILE` variable. -You can use profiles to customize PowerShell. `$profile` is an automatic (built-in) variable that +You can use profiles to customize PowerShell. `$PROFILE` is an automatic (built-in) variable that stores the path and file name of the "CurrentUser/CurrentHost" profile. By default, the profile does not exist, even though PowerShell stores a path and file name for it. -In this command, the `$profile` variable represents the path of the file. **ItemType** parameter +In this command, the `$PROFILE` variable represents the path of the file. **ItemType** parameter specifies that the command creates a file. The **Force** parameter lets you create a file in the profile path, even when the directories in the path do not exist. @@ -112,7 +112,7 @@ For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Co and [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). ```powershell -New-Item -Path $profile -ItemType "file" -Force +New-Item -Path $PROFILE -ItemType "file" -Force ``` ### Example 4: Create a directory in a different directory diff --git a/reference/7.4/Microsoft.PowerShell.Management/Pop-Location.md b/reference/7.4/Microsoft.PowerShell.Management/Pop-Location.md index 8a37b617c31a..58c9649df621 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Pop-Location.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Pop-Location.md @@ -182,7 +182,7 @@ If you make a named location stack the current location stack, you can no longer `Push-Location` or `Pop-Location` cmdlets to add or get items from the default stack or use the `Get-Location` cmdlet to display the locations in the unnamed stack. To make the unnamed stack the current stack, use the **StackName** parameter of the `Set-Location` cmdlet with a value of -`$Null` or an empty string (`""`). +`$null` or an empty string (`""`). You can also refer to `Pop-Location` by its built-in alias, `popd`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md index 89aa569baa6a..d5869cb17185 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -84,7 +84,7 @@ Set-ItemProperty -LiteralPath -InputObject [-PassThru] [-F The `Set-ItemProperty` cmdlet changes the value of the property of the specified item. You can use the cmdlet to establish or change the properties of items. For example, you can use `Set-ItemProperty` to set the value of the **IsReadOnly** property of a -file object to `$True`. +file object to `$true`. You also use `Set-ItemProperty` to create and change registry values and data. For example, you can add a new registry entry to a key and establish or change its value. @@ -170,7 +170,7 @@ Th example uses `Get-ChildItem` to get the `weekly.txt` file. The file object is specify the property and its new value. ```powershell -Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $True +Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $true ``` ## PARAMETERS diff --git a/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index a8cc88a6042a..9ab34198c758 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -62,7 +62,7 @@ local computer. Use the **Name** parameter to identify the session configuration that you want to change. Use the other parameters to specify new values for the properties of the session configuration. To delete a property value from the configuration, and use the default value, enter an empty string (`""`) or a -value of `$Null` for the corresponding parameter. +value of `$null` for the corresponding parameter. Starting in PowerShell 3.0, you can use a session configuration file to define a session configuration. This feature provides a simple and discoverable method for setting and changing the @@ -97,7 +97,7 @@ The third command removes the `AdminConfig.ps1` script from the configuration. ```powershell Register-PSSessionConfiguration -Name "AdminShell" -AssemblyName "C:\Shells\AdminShell.dll" -ConfigurationTypeName "AdminClass" Set-PSSessionConfiguration -Name "AdminShell" -StartupScript "AdminConfig.ps1" -Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $Null +Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $null ``` ### Example 2: Display results @@ -483,7 +483,7 @@ use a session configuration in a session, users must have at least `Execute(Invo the configuration. To use the default security descriptor for the configuration, enter an empty string (`""`) or a -value of `$Null`. The default is the root SDDL in the `WSMan:` drive. +value of `$null`. The default is the root SDDL in the `WSMan:` drive. If the security descriptor is complex, consider using the **ShowSecurityDescriptorUI** parameter instead of this one. You cannot use both parameters in the same command. @@ -555,7 +555,7 @@ Specifies the startup script for the configuration. Enter the fully qualified pa script. The specified script runs in the new session that uses the session configuration. To delete a startup script from a session configuration, enter an empty string (`""`) or a value of -`$Null`. +`$null`. You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command diff --git a/reference/7.5/Microsoft.PowerShell.Core/Set-StrictMode.md b/reference/7.5/Microsoft.PowerShell.Core/Set-StrictMode.md index 89997409e7f5..8371295def23 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Set-StrictMode.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Set-StrictMode.md @@ -40,10 +40,10 @@ override the setting inherited from the global scope. When `Set-StrictMode` is off, PowerShell has the following behaviors: -- Uninitialized variables are assumed to have a value of `0` (zero) or `$Null`, depending on type -- References to non-existent properties return `$Null` +- Uninitialized variables are assumed to have a value of `0` (zero) or `$null`, depending on type +- References to non-existent properties return `$null` - Results of improper function syntax vary with the error conditions -- Attempting to retrieve a value using an invalid index in an array returns `$Null` +- Attempting to retrieve a value using an invalid index in an array returns `$null` ## EXAMPLES @@ -137,7 +137,7 @@ which nothing is added. With version `2.0` strict mode, it's correctly interpret syntax for submitting two values. Without version `2.0`, the reference to the non-existent **Month** property of a string returns only -`$Null`. With version `2.0`, it's interpreted correctly as a reference error. +`$null`. With version `2.0`, it's interpreted correctly as a reference error. ### Example 3: Turn on strict mode as version 3.0 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md index b96a673be129..ae8545d72571 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -36,7 +36,7 @@ cmdlet also generates an error for each missing file. ### Example 1: Test a manifest ```powershell -Test-ModuleManifest -Path "$pshome\Modules\TestModule.psd1" +Test-ModuleManifest -Path "$PSHOME\Modules\TestModule.psd1" ``` This command tests the `TestModule.psd1` module manifest. @@ -44,14 +44,14 @@ This command tests the `TestModule.psd1` module manifest. ### Example 2: Test a manifest by using the pipeline ```powershell -"$pshome\Modules\TestModule.psd1" | Test-ModuleManifest +"$PSHOME\Modules\TestModule.psd1" | Test-ModuleManifest ``` ```Output Test-ModuleManifest : The specified type data file 'C:\Windows\System32\Wi ndowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml' could not be processed because the file was not found. Please correct the path and try again. At line:1 char:34 -+ "$pshome\Modules\TestModule.psd1" | test-modulemanifest <<<< ++ "$PSHOME\Modules\TestModule.psd1" | test-modulemanifest <<<< + CategoryInfo : ResourceUnavailable: (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml:String) [Test-ModuleManifest], FileNotFoundException + FullyQualifiedErrorId : Modules_TypeDataFileNotFound,Microsoft.PowerShell.Commands.TestModuleManifestCommandName @@ -87,7 +87,7 @@ function Test-ManifestBool ($path) ``` This function is like `Test-ModuleManifest`, but it returns a Boolean value. The function returns -`$True` if the manifest passed the test and `$false` otherwise. +`$true` if the manifest passed the test and `$false` otherwise. The function uses the Get-ChildItem cmdlet, alias = dir, to get the module manifest specified by the `$path` variable. The command uses a pipeline operator (`|`) to pass the file object to @@ -99,7 +99,7 @@ object that `Test-ModuleManifest` returns in the $a variable. Therefore, the obj displayed. Then, in a separate command, the function displays the value of the `$?` automatic variable. If the -previous command generates no error, the command displays `$True`, and `$false` otherwise. +previous command generates no error, the command displays `$true`, and `$false` otherwise. You can use this function in conditional statements, such as those that might precede an `Import-Module` command or a command that uses the module. diff --git a/reference/7.5/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md b/reference/7.5/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md index 3cb3a8a5ef0f..2d5ebd7bac14 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md @@ -25,7 +25,7 @@ Test-PSSessionConfigurationFile [-Path] [] This cmdlet verifies that a session configuration file contains valid keys and the values are of the correct type. For enumerated values, the cmdlet verifies that the specified values are valid. -The cmdlet returns `$True` if the file passes all tests and `$false` if it does not. To find any +The cmdlet returns `$true` if the file passes all tests and `$false` if it does not. To find any errors, use the **Verbose** parameter. `Test-PSSessionConfigurationFile` verifies the session configuration files, such as those created by diff --git a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md index 3da6409ab496..684161e582a8 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md @@ -364,7 +364,7 @@ Get-Command | Where-Object { $_.OutputType } ```powershell # Use Where-Object to get objects that are containers. This gets objects that -# have the **PSIsContainer** property with a value of $True and excludes all +# have the **PSIsContainer** property with a value of $true and excludes all # others. Get-ChildItem | Where-Object PSIsContainer Get-ChildItem | Where-Object { $_.PSIsContainer } diff --git a/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md index 4510a4b416b2..aa19da6fd06a 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md @@ -131,7 +131,7 @@ The steps to create a read-only file are included in the example. ```powershell New-Item -Path .\IsReadOnlyTextFile.txt -ItemType File -Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $True +Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $true Get-ChildItem -Path .\IsReadOnlyTextFile.txt Add-Content -Path .\IsReadOnlyTextFile.txt -Value 'Add value to read-only text file' -Force Get-Content -Path .\IsReadOnlyTextFile.txt diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Get-Process.md index 2b28077359d5..99a7f190db51 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-Process.md @@ -118,7 +118,7 @@ cmdlet, then to the `Format-Table` cmdlet, which formats the processes by using view. The **Priority** view, and other views, are defined in the PS1XML format files in the PowerShell -home directory (`$pshome`). +home directory (`$PSHOME`). ### Example 5: Add a property to the standard Get-Process output display diff --git a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md index 1991cbb25341..029836c41a96 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md @@ -95,13 +95,13 @@ New-Item -Path "c:\" -Name "Logfiles" -ItemType "directory" ### Example 3: Create a profile -This command creates a PowerShell profile in the path that is specified by the `$profile` variable. +This command creates a PowerShell profile in the path that is specified by the `$PROFILE` variable. -You can use profiles to customize PowerShell. `$profile` is an automatic (built-in) variable that +You can use profiles to customize PowerShell. `$PROFILE` is an automatic (built-in) variable that stores the path and file name of the "CurrentUser/CurrentHost" profile. By default, the profile does not exist, even though PowerShell stores a path and file name for it. -In this command, the `$profile` variable represents the path of the file. **ItemType** parameter +In this command, the `$PROFILE` variable represents the path of the file. **ItemType** parameter specifies that the command creates a file. The **Force** parameter lets you create a file in the profile path, even when the directories in the path do not exist. @@ -113,7 +113,7 @@ For more information, see and [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). ```powershell -New-Item -Path $profile -ItemType "file" -Force +New-Item -Path $PROFILE -ItemType "file" -Force ``` ### Example 4: Create a directory in a different directory diff --git a/reference/7.5/Microsoft.PowerShell.Management/Pop-Location.md b/reference/7.5/Microsoft.PowerShell.Management/Pop-Location.md index 6133b5cd36d4..ed42a6ba0f06 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Pop-Location.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Pop-Location.md @@ -182,7 +182,7 @@ If you make a named location stack the current location stack, you can no longer `Push-Location` or `Pop-Location` cmdlets to add or get items from the default stack or use the `Get-Location` cmdlet to display the locations in the unnamed stack. To make the unnamed stack the current stack, use the **StackName** parameter of the `Set-Location` cmdlet with a value of -`$Null` or an empty string (`""`). +`$null` or an empty string (`""`). You can also refer to `Pop-Location` by its built-in alias, `popd`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md index 459584a6c74a..ed1705387254 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -84,7 +84,7 @@ Set-ItemProperty -LiteralPath -InputObject [-PassThru] [-F The `Set-ItemProperty` cmdlet changes the value of the property of the specified item. You can use the cmdlet to establish or change the properties of items. For example, you can use `Set-ItemProperty` to set the value of the **IsReadOnly** property of a -file object to `$True`. +file object to `$true`. You also use `Set-ItemProperty` to create and change registry values and data. For example, you can add a new registry entry to a key and establish or change its value. @@ -170,7 +170,7 @@ Th example uses `Get-ChildItem` to get the `weekly.txt` file. The file object is specify the property and its new value. ```powershell -Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $True +Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $true ``` ## PARAMETERS diff --git a/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index 097c2ce4e990..2b42597f8682 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -62,7 +62,7 @@ local computer. Use the **Name** parameter to identify the session configuration that you want to change. Use the other parameters to specify new values for the properties of the session configuration. To delete a property value from the configuration, and use the default value, enter an empty string (`""`) or a -value of `$Null` for the corresponding parameter. +value of `$null` for the corresponding parameter. Starting in PowerShell 3.0, you can use a session configuration file to define a session configuration. This feature provides a simple and discoverable method for setting and changing the @@ -97,7 +97,7 @@ The third command removes the `AdminConfig.ps1` script from the configuration. ```powershell Register-PSSessionConfiguration -Name "AdminShell" -AssemblyName "C:\Shells\AdminShell.dll" -ConfigurationTypeName "AdminClass" Set-PSSessionConfiguration -Name "AdminShell" -StartupScript "AdminConfig.ps1" -Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $Null +Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $null ``` ### Example 2: Display results @@ -483,7 +483,7 @@ use a session configuration in a session, users must have at least `Execute(Invo the configuration. To use the default security descriptor for the configuration, enter an empty string (`""`) or a -value of `$Null`. The default is the root SDDL in the `WSMan:` drive. +value of `$null`. The default is the root SDDL in the `WSMan:` drive. If the security descriptor is complex, consider using the **ShowSecurityDescriptorUI** parameter instead of this one. You cannot use both parameters in the same command. @@ -555,7 +555,7 @@ Specifies the startup script for the configuration. Enter the fully qualified pa script. The specified script runs in the new session that uses the session configuration. To delete a startup script from a session configuration, enter an empty string (`""`) or a value of -`$Null`. +`$null`. You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command diff --git a/reference/7.6/Microsoft.PowerShell.Core/Set-StrictMode.md b/reference/7.6/Microsoft.PowerShell.Core/Set-StrictMode.md index 407c680cc136..6925af5bd53b 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Set-StrictMode.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Set-StrictMode.md @@ -40,10 +40,10 @@ override the setting inherited from the global scope. When `Set-StrictMode` is off, PowerShell has the following behaviors: -- Uninitialized variables are assumed to have a value of `0` (zero) or `$Null`, depending on type -- References to non-existent properties return `$Null` +- Uninitialized variables are assumed to have a value of `0` (zero) or `$null`, depending on type +- References to non-existent properties return `$null` - Results of improper function syntax vary with the error conditions -- Attempting to retrieve a value using an invalid index in an array returns `$Null` +- Attempting to retrieve a value using an invalid index in an array returns `$null` ## EXAMPLES @@ -137,7 +137,7 @@ which nothing is added. With version `2.0` strict mode, it's correctly interpret syntax for submitting two values. Without version `2.0`, the reference to the non-existent **Month** property of a string returns only -`$Null`. With version `2.0`, it's interpreted correctly as a reference error. +`$null`. With version `2.0`, it's interpreted correctly as a reference error. ### Example 3: Turn on strict mode as version 3.0 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 6e060c5d2a28..232e20d70f39 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -36,7 +36,7 @@ cmdlet also generates an error for each missing file. ### Example 1: Test a manifest ```powershell -Test-ModuleManifest -Path "$pshome\Modules\TestModule.psd1" +Test-ModuleManifest -Path "$PSHOME\Modules\TestModule.psd1" ``` This command tests the `TestModule.psd1` module manifest. @@ -44,14 +44,14 @@ This command tests the `TestModule.psd1` module manifest. ### Example 2: Test a manifest by using the pipeline ```powershell -"$pshome\Modules\TestModule.psd1" | Test-ModuleManifest +"$PSHOME\Modules\TestModule.psd1" | Test-ModuleManifest ``` ```Output Test-ModuleManifest : The specified type data file 'C:\Windows\System32\Wi ndowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml' could not be processed because the file was not found. Please correct the path and try again. At line:1 char:34 -+ "$pshome\Modules\TestModule.psd1" | test-modulemanifest <<<< ++ "$PSHOME\Modules\TestModule.psd1" | test-modulemanifest <<<< + CategoryInfo : ResourceUnavailable: (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml:String) [Test-ModuleManifest], FileNotFoundException + FullyQualifiedErrorId : Modules_TypeDataFileNotFound,Microsoft.PowerShell.Commands.TestModuleManifestCommandName @@ -87,7 +87,7 @@ function Test-ManifestBool ($path) ``` This function is like `Test-ModuleManifest`, but it returns a Boolean value. The function returns -`$True` if the manifest passed the test and `$false` otherwise. +`$true` if the manifest passed the test and `$false` otherwise. The function uses the Get-ChildItem cmdlet, alias = dir, to get the module manifest specified by the `$path` variable. The command uses a pipeline operator (`|`) to pass the file object to @@ -99,7 +99,7 @@ object that `Test-ModuleManifest` returns in the $a variable. Therefore, the obj displayed. Then, in a separate command, the function displays the value of the `$?` automatic variable. If the -previous command generates no error, the command displays `$True`, and `$false` otherwise. +previous command generates no error, the command displays `$true`, and `$false` otherwise. You can use this function in conditional statements, such as those that might precede an `Import-Module` command or a command that uses the module. diff --git a/reference/7.6/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md b/reference/7.6/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md index e9eeae081172..17142b08b4fb 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Test-PSSessionConfigurationFile.md @@ -25,7 +25,7 @@ Test-PSSessionConfigurationFile [-Path] [] This cmdlet verifies that a session configuration file contains valid keys and the values are of the correct type. For enumerated values, the cmdlet verifies that the specified values are valid. -The cmdlet returns `$True` if the file passes all tests and `$false` if it does not. To find any +The cmdlet returns `$true` if the file passes all tests and `$false` if it does not. To find any errors, use the **Verbose** parameter. `Test-PSSessionConfigurationFile` verifies the session configuration files, such as those created by diff --git a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md index 92b5679fc08e..8b22dcfebaab 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md @@ -364,7 +364,7 @@ Get-Command | Where-Object { $_.OutputType } ```powershell # Use Where-Object to get objects that are containers. This gets objects that -# have the **PSIsContainer** property with a value of $True and excludes all +# have the **PSIsContainer** property with a value of $true and excludes all # others. Get-ChildItem | Where-Object PSIsContainer Get-ChildItem | Where-Object { $_.PSIsContainer } diff --git a/reference/7.6/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.6/Microsoft.PowerShell.Management/Add-Content.md index 0d60273d02ff..a55c0d54e1bc 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Add-Content.md @@ -131,7 +131,7 @@ The steps to create a read-only file are included in the example. ```powershell New-Item -Path .\IsReadOnlyTextFile.txt -ItemType File -Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $True +Set-ItemProperty -Path .\IsReadOnlyTextFile.txt -Name IsReadOnly -Value $true Get-ChildItem -Path .\IsReadOnlyTextFile.txt Add-Content -Path .\IsReadOnlyTextFile.txt -Value 'Add value to read-only text file' -Force Get-Content -Path .\IsReadOnlyTextFile.txt diff --git a/reference/7.6/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.6/Microsoft.PowerShell.Management/Get-Process.md index d8076816da43..0c2c7008e084 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Get-Process.md @@ -118,7 +118,7 @@ cmdlet, then to the `Format-Table` cmdlet, which formats the processes by using view. The **Priority** view, and other views, are defined in the PS1XML format files in the PowerShell -home directory (`$pshome`). +home directory (`$PSHOME`). ### Example 5: Add a property to the standard Get-Process output display diff --git a/reference/7.6/Microsoft.PowerShell.Management/New-Item.md b/reference/7.6/Microsoft.PowerShell.Management/New-Item.md index 11f33973de28..45bbffec1130 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.6/Microsoft.PowerShell.Management/New-Item.md @@ -95,13 +95,13 @@ New-Item -Path "c:\" -Name "Logfiles" -ItemType "directory" ### Example 3: Create a profile -This command creates a PowerShell profile in the path that is specified by the `$profile` variable. +This command creates a PowerShell profile in the path that is specified by the `$PROFILE` variable. -You can use profiles to customize PowerShell. `$profile` is an automatic (built-in) variable that +You can use profiles to customize PowerShell. `$PROFILE` is an automatic (built-in) variable that stores the path and file name of the "CurrentUser/CurrentHost" profile. By default, the profile does not exist, even though PowerShell stores a path and file name for it. -In this command, the `$profile` variable represents the path of the file. **ItemType** parameter +In this command, the `$PROFILE` variable represents the path of the file. **ItemType** parameter specifies that the command creates a file. The **Force** parameter lets you create a file in the profile path, even when the directories in the path do not exist. @@ -112,7 +112,7 @@ For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Co and [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). ```powershell -New-Item -Path $profile -ItemType "file" -Force +New-Item -Path $PROFILE -ItemType "file" -Force ``` ### Example 4: Create a directory in a different directory diff --git a/reference/7.6/Microsoft.PowerShell.Management/Pop-Location.md b/reference/7.6/Microsoft.PowerShell.Management/Pop-Location.md index 5d2305b22e8a..1e8544196191 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Pop-Location.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Pop-Location.md @@ -182,7 +182,7 @@ If you make a named location stack the current location stack, you can no longer `Push-Location` or `Pop-Location` cmdlets to add or get items from the default stack or use the `Get-Location` cmdlet to display the locations in the unnamed stack. To make the unnamed stack the current stack, use the **StackName** parameter of the `Set-Location` cmdlet with a value of -`$Null` or an empty string (`""`). +`$null` or an empty string (`""`). You can also refer to `Pop-Location` by its built-in alias, `popd`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). diff --git a/reference/7.6/Microsoft.PowerShell.Management/Set-ItemProperty.md b/reference/7.6/Microsoft.PowerShell.Management/Set-ItemProperty.md index 8fec2010cc13..4eea2511892e 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Set-ItemProperty.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Set-ItemProperty.md @@ -84,7 +84,7 @@ Set-ItemProperty -LiteralPath -InputObject [-PassThru] [-F The `Set-ItemProperty` cmdlet changes the value of the property of the specified item. You can use the cmdlet to establish or change the properties of items. For example, you can use `Set-ItemProperty` to set the value of the **IsReadOnly** property of a -file object to `$True`. +file object to `$true`. You also use `Set-ItemProperty` to create and change registry values and data. For example, you can add a new registry entry to a key and establish or change its value. @@ -170,7 +170,7 @@ Th example uses `Get-ChildItem` to get the `weekly.txt` file. The file object is specify the property and its new value. ```powershell -Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $True +Get-ChildItem weekly.txt | Set-ItemProperty -Name IsReadOnly -Value $true ``` ## PARAMETERS