From bba56a363b2142048b840a0b97daea3c585de127 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Fri, 21 Feb 2025 16:32:20 -0600 Subject: [PATCH 01/16] Update release notes for 7.6-p3 (#11812) * Update release notes for 7.6-p3 * Minor edits * Minor edits --- .../Start-Transcript.md | 4 +- .../whats-new/What-s-New-in-PowerShell-76.md | 72 +++++++++++++------ 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md index 6564694e1cf6..784a6d1aa5d1 100644 --- a/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 01/06/2025 +ms.date: 02/18/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -92,7 +92,7 @@ $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() $datetime = Get-Date -f 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() +$Transcript = Join-Path -Path $sharepath -ChildPath $filename Start-Transcript ``` diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-76.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-76.md index 9a5f9b458ada..d5b0bc40abfd 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-76.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-76.md @@ -1,56 +1,77 @@ --- title: What's New in PowerShell 7.6 description: New features and changes released in PowerShell 7.6 -ms.date: 01/17/2025 +ms.date: 02/18/2025 --- # What's New in PowerShell 7.6 -PowerShell 7.6-preview.2 includes the following features, updates, and breaking changes. PowerShell +PowerShell 7.6-preview.3 includes the following features, updates, and breaking changes. PowerShell 7.6 is built on .NET 9.0.101 GA release. For a complete list of changes, see the [CHANGELOG][04] in the GitHub repository. -## Breaking Changes - -No breaking changes were introduced in PowerShell 7.6-preview.2. - ## Updated modules -PowerShell 7.6-preview.2 includes the following updated modules: +PowerShell 7.6-preview.3 includes the following updated modules: -- **Microsoft.PowerShell.PSResourceGet** v1.1.0-RC3 +- **Microsoft.PowerShell.PSResourceGet** v1.1.0 - **PSReadLine** v2.3.6 +## Breaking Changes + +- Remove trailing space from event source name ([#24192][24192]) (Thanks @MartinGC94!) + ## Tab completion improvements -- Update Named and Statement block type inference to not consider AssignmentStatements and +- Update Named and Statement block type inference to not consider **AssignmentStatements** and Increment/decrement operators as part of their output ([#21137][21137]) (Thanks @MartinGC94!) -- Add -PropertyType argument completer for New-ItemProperty ([#21117][21117]) (Thanks +- Add `-PropertyType` argument completer for `New-ItemProperty` ([#21117][21117]) (Thanks @ArmaanMcleod!) +- Add completion single/double quote support for `-Noun` parameter for `Get-Command` + ([#24977][24977]) (Thanks @ArmaanMcleod!) +- Add completion single/double quote support for `-PSEdition` parameter for `Get-Module` + ([#24971][24971]) (Thanks @ArmaanMcleod!) +- Convert **InvalidCommandNameCharacters** in AnalysisCache to `SearchValues` for more + efficient char searching ([#24880][24880]) (Thanks @ArmaanMcleod!) +- Convert **s_charactersRequiringQuotes** in Completion Completers to `SearchValues` for more + efficient char searching ([#24879][24879]) (Thanks @ArmaanMcleod!) +- Update `IndexOfAny()` calls with invalid path/filename to `SearchValues` for more efficient + char searching ([#24896][24896]) (Thanks @ArmaanMcleod!) +- Replace `char[]` array in `CompletionRequiresQuotes` with cached `SearchValues` + ([#24907][24907]) (Thanks @ArmaanMcleod!) +- Add quote handling in `Verb`, `StrictModeVersion`, `Scope` and `PropertyType` Argument + Completers with single helper method ([#24839][24839]) (Thanks @ArmaanMcleod!) ## Cmdlet improvements -- Add -ExcludeModule parameter to Get-Command ([#18955][18955]) (Thanks @MartinGC94!) -- Return correct FileName property for Get-Item when listing alternate data streams +- Add `-ExcludeModule` parameter to `Get-Command` ([#18955][18955]) (Thanks @MartinGC94!) +- Return correct **FileName** property for `Get-Item` when listing alternate data streams ([#18019][18019]) (Thanks @kilasuit!) -- Fix Get-ItemProperty to report non-terminating error for cast exception ([#21115][21115]) (Thanks - @ArmaanMcleod!) -- Fix a bug in how Write-Host handles XmlNode object ([#24669][24669]) (Thanks @brendandburns!) +- Fix `Get-ItemProperty` to report non-terminating error for cast exception ([#21115][21115]) + (Thanks @ArmaanMcleod!) +- Fix a bug in how q handles XmlNode object ([#24669][24669]) (Thanks @brendandburns!) +- Error when `New-Item -Force` is passed an invalid directory name ([#24936][24936]) (Thanks + @kborowinski!) +- Allow `Start-Transcript` to use `$Transcript` which is a `PSObject` wrapped string to specify the + transcript path ([#24963][24963]) (Thanks @kborowinski!) +- Improve `Start-Process -Wait` polling efficiency ([#24711][24711]) (Thanks @jborean93!) +- Add completion of modules by their shortname ([#20330][20330]) (Thanks @MartinGC94!) ## Engine improvements - Added the AIShell module to telemetry collection list ([#24747][24747]) -- Added helper in EnumSingleTypeConverter to get enum names as array ([#17785][17785]) (Thanks +- Added helper in `EnumSingleTypeConverter` to get enum names as array ([#17785][17785]) (Thanks @fflaten!) -- Update DnsNameList for X509Certificate2 to use - X509SubjectAlternativeNameExtension.EnumerateDnsNames Method ([#24714][24714]) (Thanks +- Update **DnsNameList** for **X509Certificate2** to use + `X509SubjectAlternativeNameExtension.EnumerateDnsNames()` Method ([#24714][24714]) (Thanks @ArmaanMcleod!) -- Add completion of modules by their shortname ([#20330][20330]) (Thanks @MartinGC94!) +- Stringify **ErrorRecord** with empty exception message to empty string ([#24949][24949]) (Thanks + @MatejKafka!) ## Experimental features -The following experimental features are included in PowerShell 7.6-preview.2: +The following experimental features are included in PowerShell 7.6-preview.3: - [PSNativeWindowsTildeExpansion][01] - Add tilde expansion for windows native executables - [PSRedirectToVariable][02] - Allow redirecting to a variable @@ -70,6 +91,17 @@ The following experimental features are included in PowerShell 7.6-preview.2: [21115]: https://github.com/PowerShell/PowerShell/pull/21115 [21117]: https://github.com/PowerShell/PowerShell/pull/21117 [21137]: https://github.com/PowerShell/PowerShell/pull/21137 +[24192]: https://github.com/PowerShell/PowerShell/pull/24192 [24669]: https://github.com/PowerShell/PowerShell/pull/24669 +[24711]: https://github.com/PowerShell/PowerShell/pull/24711 [24714]: https://github.com/PowerShell/PowerShell/pull/24714 [24747]: https://github.com/PowerShell/PowerShell/pull/24747 +[24839]: https://github.com/PowerShell/PowerShell/pull/24839 +[24879]: https://github.com/PowerShell/PowerShell/pull/24879 +[24880]: https://github.com/PowerShell/PowerShell/pull/24880 +[24907]: https://github.com/PowerShell/PowerShell/pull/24907 +[24936]: https://github.com/PowerShell/PowerShell/pull/24936 +[24949]: https://github.com/PowerShell/PowerShell/pull/24949 +[24963]: https://github.com/PowerShell/PowerShell/pull/24963 +[24971]: https://github.com/PowerShell/PowerShell/pull/24971 +[24977]: https://github.com/PowerShell/PowerShell/pull/24977 From 120526dfced7f54bac87aa7f6635e310bc5b0ce3 Mon Sep 17 00:00:00 2001 From: Takashi Takebayashi Date: Sat, 22 Feb 2025 07:33:07 +0900 Subject: [PATCH 02/16] Fix typo (#11817) PowerSHell -> PowerShell --- .../docs-conceptual/developer/hosting/runspace03-sample.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/docs-conceptual/developer/hosting/runspace03-sample.md b/reference/docs-conceptual/developer/hosting/runspace03-sample.md index 9d07e94182f4..5a9a7221ccfc 100644 --- a/reference/docs-conceptual/developer/hosting/runspace03-sample.md +++ b/reference/docs-conceptual/developer/hosting/runspace03-sample.md @@ -56,7 +56,7 @@ namespace Microsoft.Samples.PowerShell.Runspaces /// Parameter not used. /// /// This sample demonstrates the following: - /// 1. Creating a PowerSHell object to run a script. + /// 1. Creating a PowerShell object to run a script. /// 2. Adding a script to the pipeline of the PowerShell object. /// 3. Passing input objects to the script from the calling program. /// 4. Running the script synchronously. From 597ea7c1ade51a85c038aa1413775a3ea1dd5458 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Sun, 23 Feb 2025 14:23:26 +0000 Subject: [PATCH 03/16] Fix minor typos in about_Switch (#11822) --- .../About/about_Switch.md | 24 +++++++++---------- .../About/about_Switch.md | 24 +++++++++---------- .../About/about_Switch.md | 24 +++++++++---------- .../About/about_Switch.md | 24 +++++++++---------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md index 9a8bf5b134fa..5e1d9cdd2d19 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md @@ -110,14 +110,14 @@ conditions. It's equivalent to an `else` clause in an `if` statement. Only one comparison is case-insensitive. - **CaseSensitive** - Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. -- **File**- Takes input from a file rather than a ``. The file - is read a line at a time and evaluated by the `switch` statement. By default, - the comparison is case-insensitive. The **File** parameter only supports one - file. If multiple **File** parameters are included, only the last one is - used.For more information see [File parameter examples][01]. +- **File** - Takes input from a file rather than a ``. The + file is read a line at a time and evaluated by the `switch` statement. By + default, the comparison is case-insensitive. The **File** parameter only + supports one file. If multiple **File** parameters are included, only the + last one is used. For more information see [File parameter examples][01]. - **Regex** - Performs regular expression matching of the value to the condition. If the match clause isn't a string, this parameter is ignored. - The comparison is case-insensitive. The `$matches` automatic variable is + The comparison is case-insensitive. The `$Matches` automatic variable is available for use within the matching statement block. > [!NOTE] @@ -327,7 +327,7 @@ switch -Regex ($target) { } '^(http[s]?)\://.*$' { - "$_ is a web address that uses $($matches[1])" + "$_ is a web address that uses $($Matches[1])" break } } @@ -401,12 +401,12 @@ Using the `switch` statement with the **File** parameter is an efficient way to process large files line by line. PowerShell streams the lines of the file to the `switch` statement. Each line is processed individually. -You can terminate -the processing before reaching the end of the file by using the `break` keyword -in the action statement. The `switch` statement is more efficient than using -`Get-Content` to process large files line by line. +You can terminate the processing before reaching the end of the file by using +the `break` keyword in the action statement. The `switch` statement is more +efficient than using `Get-Content` to process large files line by line. -You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and efficient line-by-line pattern matching. +You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and +efficient line-by-line pattern matching. The following example reads the `README.md` in the PowerShell-Docs repository. It outputs each line until it reaches the line that starts with `##`. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md index 353b823c9068..c8178419682b 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Switch.md @@ -110,14 +110,14 @@ conditions. It's equivalent to an `else` clause in an `if` statement. Only one comparison is case-insensitive. - **CaseSensitive** - Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. -- **File**- Takes input from a file rather than a ``. The file - is read a line at a time and evaluated by the `switch` statement. By default, - the comparison is case-insensitive. The **File** parameter only supports one - file. If multiple **File** parameters are included, only the last one is - used.For more information see [File parameter examples][01]. +- **File** - Takes input from a file rather than a ``. The + file is read a line at a time and evaluated by the `switch` statement. By + default, the comparison is case-insensitive. The **File** parameter only + supports one file. If multiple **File** parameters are included, only the + last one is used. For more information see [File parameter examples][01]. - **Regex** - Performs regular expression matching of the value to the condition. If the match clause isn't a string, this parameter is ignored. - The comparison is case-insensitive. The `$matches` automatic variable is + The comparison is case-insensitive. The `$Matches` automatic variable is available for use within the matching statement block. > [!NOTE] @@ -327,7 +327,7 @@ switch -Regex ($target) { } '^(http[s]?)\://.*$' { - "$_ is a web address that uses $($matches[1])" + "$_ is a web address that uses $($Matches[1])" break } } @@ -401,12 +401,12 @@ Using the `switch` statement with the **File** parameter is an efficient way to process large files line by line. PowerShell streams the lines of the file to the `switch` statement. Each line is processed individually. -You can terminate -the processing before reaching the end of the file by using the `break` keyword -in the action statement. The `switch` statement is more efficient than using -`Get-Content` to process large files line by line. +You can terminate the processing before reaching the end of the file by using +the `break` keyword in the action statement. The `switch` statement is more +efficient than using `Get-Content` to process large files line by line. -You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and efficient line-by-line pattern matching. +You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and +efficient line-by-line pattern matching. The following example reads the `README.md` in the PowerShell-Docs repository. It outputs each line until it reaches the line that starts with `##`. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md index e2fee3aed9c3..bc70c994080c 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Switch.md @@ -110,14 +110,14 @@ conditions. It's equivalent to an `else` clause in an `if` statement. Only one comparison is case-insensitive. - **CaseSensitive** - Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. -- **File**- Takes input from a file rather than a ``. The file - is read a line at a time and evaluated by the `switch` statement. By default, - the comparison is case-insensitive. The **File** parameter only supports one - file. If multiple **File** parameters are included, only the last one is - used.For more information see [File parameter examples][01]. +- **File** - Takes input from a file rather than a ``. The + file is read a line at a time and evaluated by the `switch` statement. By + default, the comparison is case-insensitive. The **File** parameter only + supports one file. If multiple **File** parameters are included, only the + last one is used. For more information see [File parameter examples][01]. - **Regex** - Performs regular expression matching of the value to the condition. If the match clause isn't a string, this parameter is ignored. - The comparison is case-insensitive. The `$matches` automatic variable is + The comparison is case-insensitive. The `$Matches` automatic variable is available for use within the matching statement block. > [!NOTE] @@ -327,7 +327,7 @@ switch -Regex ($target) { } '^(http[s]?)\://.*$' { - "$_ is a web address that uses $($matches[1])" + "$_ is a web address that uses $($Matches[1])" break } } @@ -401,12 +401,12 @@ Using the `switch` statement with the **File** parameter is an efficient way to process large files line by line. PowerShell streams the lines of the file to the `switch` statement. Each line is processed individually. -You can terminate -the processing before reaching the end of the file by using the `break` keyword -in the action statement. The `switch` statement is more efficient than using -`Get-Content` to process large files line by line. +You can terminate the processing before reaching the end of the file by using +the `break` keyword in the action statement. The `switch` statement is more +efficient than using `Get-Content` to process large files line by line. -You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and efficient line-by-line pattern matching. +You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and +efficient line-by-line pattern matching. The following example reads the `README.md` in the PowerShell-Docs repository. It outputs each line until it reaches the line that starts with `##`. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Switch.md index e26a256d9337..5c4988eaf933 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Switch.md @@ -110,14 +110,14 @@ conditions. It's equivalent to an `else` clause in an `if` statement. Only one comparison is case-insensitive. - **CaseSensitive** - Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. -- **File**- Takes input from a file rather than a ``. The file - is read a line at a time and evaluated by the `switch` statement. By default, - the comparison is case-insensitive. The **File** parameter only supports one - file. If multiple **File** parameters are included, only the last one is - used.For more information see [File parameter examples][01]. +- **File** - Takes input from a file rather than a ``. The + file is read a line at a time and evaluated by the `switch` statement. By + default, the comparison is case-insensitive. The **File** parameter only + supports one file. If multiple **File** parameters are included, only the + last one is used. For more information see [File parameter examples][01]. - **Regex** - Performs regular expression matching of the value to the condition. If the match clause isn't a string, this parameter is ignored. - The comparison is case-insensitive. The `$matches` automatic variable is + The comparison is case-insensitive. The `$Matches` automatic variable is available for use within the matching statement block. > [!NOTE] @@ -327,7 +327,7 @@ switch -Regex ($target) { } '^(http[s]?)\://.*$' { - "$_ is a web address that uses $($matches[1])" + "$_ is a web address that uses $($Matches[1])" break } } @@ -401,12 +401,12 @@ Using the `switch` statement with the **File** parameter is an efficient way to process large files line by line. PowerShell streams the lines of the file to the `switch` statement. Each line is processed individually. -You can terminate -the processing before reaching the end of the file by using the `break` keyword -in the action statement. The `switch` statement is more efficient than using -`Get-Content` to process large files line by line. +You can terminate the processing before reaching the end of the file by using +the `break` keyword in the action statement. The `switch` statement is more +efficient than using `Get-Content` to process large files line by line. -You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and efficient line-by-line pattern matching. +You can combine `switch -File` with `-Wildcard` or `-Regex` for flexible and +efficient line-by-line pattern matching. The following example reads the `README.md` in the PowerShell-Docs repository. It outputs each line until it reaches the line that starts with `##`. From ac39029e9ba88dc11d069e4b556b2c316b3032b6 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 14:42:17 +0000 Subject: [PATCH 04/16] Fix $args automatic variable case (#11824) --- .../About/about_Debuggers.md | 4 ++-- .../About/about_Functions.md | 8 ++++---- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 2 +- .../About/about_Splatting.md | 18 +++++++++--------- .../Register-WmiEvent.md | 2 +- .../Microsoft.PowerShell.Utility/Get-Event.md | 4 ++-- .../Microsoft.PowerShell.Utility/New-Event.md | 2 +- .../Register-EngineEvent.md | 2 +- .../Register-ObjectEvent.md | 2 +- .../About/about_Debuggers.md | 4 ++-- .../About/about_Functions.md | 8 ++++---- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 2 +- .../About/about_Splatting.md | 18 +++++++++--------- .../Microsoft.PowerShell.Utility/Get-Event.md | 4 ++-- .../Microsoft.PowerShell.Utility/New-Event.md | 2 +- .../Register-EngineEvent.md | 2 +- .../Register-ObjectEvent.md | 2 +- .../About/about_Debuggers.md | 4 ++-- .../About/about_Functions.md | 8 ++++---- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 2 +- .../About/about_Splatting.md | 18 +++++++++--------- .../Microsoft.PowerShell.Utility/Get-Event.md | 4 ++-- .../Microsoft.PowerShell.Utility/New-Event.md | 2 +- .../Register-EngineEvent.md | 2 +- .../Register-ObjectEvent.md | 2 +- .../About/about_Debuggers.md | 4 ++-- .../About/about_Functions.md | 8 ++++---- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 2 +- .../About/about_Splatting.md | 18 +++++++++--------- .../Microsoft.PowerShell.Utility/Get-Event.md | 4 ++-- .../Microsoft.PowerShell.Utility/New-Event.md | 2 +- .../Register-EngineEvent.md | 2 +- .../Register-ObjectEvent.md | 2 +- ...-Debug-Scripts-in-Windows-PowerShell-ISE.md | 4 ++-- 38 files changed, 91 insertions(+), 91 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md index 7f2e428624c3..45cf224e70b9 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -126,7 +126,7 @@ for the following automatic variables: ```powershell $_ -$Args +$args $Input $MyInvocation $PSBoundParameters @@ -144,7 +144,7 @@ variable. For example, ```powershell -$scriptArgs = $Args +$scriptArgs = $args $scriptname = $MyInvocation.PSCommandPath ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md index 4a99c9933b9a..60a22f5a2afa 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md @@ -423,15 +423,15 @@ need to declare or enumerate the command parameters, or change the function when command parameters change. The following sample function calls the `Get-Command` cmdlet. The command uses -`@Args` to represent the parameters of `Get-Command`. +`@args` to represent the parameters of `Get-Command`. ```powershell -function Get-MyCommand { Get-Command @Args } +function Get-MyCommand { Get-Command @args } ``` You can use all the parameters of `Get-Command` when you call the `Get-MyCommand` function. The parameters and parameter values are passed to the -command using `@Args`. +command using `@args`. ```powershell Get-MyCommand -Name Get-ChildItem @@ -443,7 +443,7 @@ CommandType Name ModuleName Cmdlet Get-ChildItem Microsoft.PowerShell.Management ``` -The `@Args` feature uses the `$Args` automatic parameter, which represents +The `@args` feature uses the `$args` automatic parameter, which represents undeclared cmdlet parameters and values from remaining arguments. For more information, see [about_Splatting][19]. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index fa1f5ea53f36..7472da20db6f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -23,7 +23,7 @@ When you use the `CmdletBinding` attribute, PowerShell automatically adds the Common Parameters. You can't create any parameters that use the same names as the Common Parameters. For more information, see [about_CommonParameters][06]. -Beginning in PowerShell 3.0, you can use splatting with `@Args` to represent +Beginning in PowerShell 3.0, you can use splatting with `@args` to represent the parameters in a command. Splatting is valid on simple and advanced functions. For more information, see [about_Functions][14] and [about_Splatting][17]. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 98c1b72b8c70..1228aefab39c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -24,7 +24,7 @@ the Common Parameters. For more information, see [about_CommonParameters][02]. PowerShell binds the parameters of functions that have the `CmdletBinding` attribute in the same way that it binds the parameters of compiled cmdlets. The `$PSCmdlet` automatic variable is available to functions with the -`CmdletBinding` attribute, but the `$Args` variable is not available. +`CmdletBinding` attribute, but the `$args` variable is not available. In functions that have the `CmdletBinding` attribute, unknown parameters and positional arguments that have no matching positional parameters cause diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md index a5406a7cc01c..eba820886ca3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -258,22 +258,22 @@ You can use splatting to represent the parameters of a command. This technique is useful when you are creating a proxy function, that is, a function that calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent the command +To splat the parameters of a command, use `@args` to represent the command parameters. This technique is easier than enumerating command parameters and it works without revision even if the parameters of the called command change. -The feature uses the `$Args` automatic variable, which contains all unassigned +The feature uses the `$args` automatic variable, which contains all unassigned parameter values. For example, the following function calls the `Get-Process` cmdlet. In this -function, `@Args` represents all the parameters of the `Get-Process` cmdlet. +function, `@args` represents all the parameters of the `Get-Process` cmdlet. ```powershell -function Get-MyProcess { Get-Process @Args } +function Get-MyProcess { Get-Process @args } ``` When you use the `Get-MyProcess` function, all unassigned parameters and -parameter values are passed to `@Args`, as shown in the following commands. +parameter values are passed to `@args`, as shown in the following commands. ```powershell Get-MyProcess -Name PowerShell @@ -295,16 +295,16 @@ ProductVersion FileVersion FileName 6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly declared parameters. You +You can use `@args` in a function that has explicitly declared parameters. You can use it more than once in a function, but all parameters that you enter are -passed to all instances of `@Args`, as shown in the following example. +passed to all instances of `@args`, as shown in the following example. ```powershell function Get-MyCommand { Param ([switch]$P, [switch]$C) - if ($P) { Get-Process @Args } - if ($C) { Get-Command @Args } + if ($P) { Get-Process @args } + if ($C) { Get-Command @args } } Get-MyCommand -P -C -Name PowerShell diff --git a/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md b/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md index 92ed62d05439..cc626c6186c4 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md @@ -122,7 +122,7 @@ event is raised instead of sending the event to the event queue. Enclose the com (`{}`) to create a script block. The value of **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`, `$EventArgs`, and -`$Args` automatic variables, which provide information about the event to the **Action** script +`$args` automatic variables, which provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). When you specify an action, `Register-WmiEvent` returns an event job object that represents that diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Event.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Event.md index 9331c08ceffc..a038ee47b0da 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Event.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Event.md @@ -186,8 +186,8 @@ The `Get-Event` cmdlet returns a **PSEventArgs** object automatic variable contains this value. - SourceArgs. All parameters of the original event signature. For a standard event signature, - `$Args[0]` represents the sender, and `$Args[1]` represents the **SourceEventArgs**. In the - value of the **Action** parameter, the `$Args` automatic variable contains this value. + `$args[0]` represents the sender, and `$args[1]` represents the **SourceEventArgs**. In the + value of the **Action** parameter, the `$args` automatic variable contains this value. - SourceIdentifier. A string that identifies the event subscription. In the value of the **Action** parameter, the **SourceIdentifier** property of the `$Event` automatic variable diff --git a/reference/5.1/Microsoft.PowerShell.Utility/New-Event.md b/reference/5.1/Microsoft.PowerShell.Utility/New-Event.md index 42789a6508bd..e029269ecf27 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/New-Event.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/New-Event.md @@ -59,7 +59,7 @@ PS C:\> function Enable-ProcessCreationEvent $Identifier = "WMI.ProcessCreated" Register-ObjectEvent $ProcessWatcher "EventArrived" -SupportEvent $Identifier -Action { - [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $Args[0] -EventArguments $Args[1].SourceEventArgs.NewEvent.TargetInstance) + [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $args[0] -EventArguments $args[1].SourceEventArgs.NewEvent.TargetInstance) } } ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 97ba04840365..501f2dd1849d 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -160,7 +160,7 @@ instead of sending the event to the event queue. Enclose the commands in braces script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables, which provide information about the event to the +`$EventArgs`, and `$args` automatic variables, which provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index d8a1a7c81392..339cad448564 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -196,7 +196,7 @@ raised, instead of sending the event to the event queue. Enclose the commands in create a script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables. These variables provide information about the event +`$EventArgs`, and `$args` automatic variables. These variables provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). When you specify an action, `Register-ObjectEvent` returns an event job object that represents diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md index 338b8af7d3e0..b151cefb104b 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -126,7 +126,7 @@ for the following automatic variables: ```powershell $_ -$Args +$args $Input $MyInvocation $PSBoundParameters @@ -144,7 +144,7 @@ variable. For example, ```powershell -$scriptArgs = $Args +$scriptArgs = $args $scriptname = $MyInvocation.PSCommandPath ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md index dfe2657a359f..ee7fa3b771d3 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md @@ -450,15 +450,15 @@ need to declare or enumerate the command parameters, or change the function when command parameters change. The following sample function calls the `Get-Command` cmdlet. The command uses -`@Args` to represent the parameters of `Get-Command`. +`@args` to represent the parameters of `Get-Command`. ```powershell -function Get-MyCommand { Get-Command @Args } +function Get-MyCommand { Get-Command @args } ``` You can use all the parameters of `Get-Command` when you call the `Get-MyCommand` function. The parameters and parameter values are passed to the -command using `@Args`. +command using `@args`. ```powershell Get-MyCommand -Name Get-ChildItem @@ -470,7 +470,7 @@ CommandType Name ModuleName Cmdlet Get-ChildItem Microsoft.PowerShell.Management ``` -The `@Args` feature uses the `$Args` automatic parameter, which represents +The `@args` feature uses the `$args` automatic parameter, which represents undeclared cmdlet parameters and values from remaining arguments. For more information, see [about_Splatting][19]. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 969eb0672a30..b3aac9fa1c76 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -23,7 +23,7 @@ When you use the `CmdletBinding` attribute, PowerShell automatically adds the Common Parameters. You can't create any parameters that use the same names as the Common Parameters. For more information, see [about_CommonParameters][06]. -Beginning in PowerShell 3.0, you can use splatting with `@Args` to represent +Beginning in PowerShell 3.0, you can use splatting with `@args` to represent the parameters in a command. Splatting is valid on simple and advanced functions. For more information, see [about_Functions][14] and [about_Splatting][17]. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 19b5b5808e6f..2039789e526d 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -24,7 +24,7 @@ the Common Parameters. For more information, see [about_CommonParameters][02]. PowerShell binds the parameters of functions that have the `CmdletBinding` attribute in the same way that it binds the parameters of compiled cmdlets. The `$PSCmdlet` automatic variable is available to functions with the -`CmdletBinding` attribute, but the `$Args` variable is not available. +`CmdletBinding` attribute, but the `$args` variable is not available. In functions that have the `CmdletBinding` attribute, unknown parameters and positional arguments that have no matching positional parameters cause diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md index 96b52c518161..baa55973bebf 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -301,22 +301,22 @@ You can use splatting to represent the parameters of a command. This technique is useful when you are creating a proxy function, that is, a function that calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent the command +To splat the parameters of a command, use `@args` to represent the command parameters. This technique is easier than enumerating command parameters and it works without revision even if the parameters of the called command change. -The feature uses the `$Args` automatic variable, which contains all unassigned +The feature uses the `$args` automatic variable, which contains all unassigned parameter values. For example, the following function calls the `Get-Process` cmdlet. In this -function, `@Args` represents all the parameters of the `Get-Process` cmdlet. +function, `@args` represents all the parameters of the `Get-Process` cmdlet. ```powershell -function Get-MyProcess { Get-Process @Args } +function Get-MyProcess { Get-Process @args } ``` When you use the `Get-MyProcess` function, all unassigned parameters and -parameter values are passed to `@Args`, as shown in the following commands. +parameter values are passed to `@args`, as shown in the following commands. ```powershell Get-MyProcess -Name PowerShell @@ -338,16 +338,16 @@ ProductVersion FileVersion FileName 6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly declared parameters. You +You can use `@args` in a function that has explicitly declared parameters. You can use it more than once in a function, but all parameters that you enter are -passed to all instances of `@Args`, as shown in the following example. +passed to all instances of `@args`, as shown in the following example. ```powershell function Get-MyCommand { Param ([switch]$P, [switch]$C) - if ($P) { Get-Process @Args } - if ($C) { Get-Command @Args } + if ($P) { Get-Process @args } + if ($C) { Get-Command @args } } Get-MyCommand -P -C -Name PowerShell diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Event.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Event.md index 41072f4e8694..765814b3f992 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Event.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Event.md @@ -188,8 +188,8 @@ The `Get-Event` cmdlet returns a **PSEventArgs** object automatic variable contains this value. - SourceArgs. All parameters of the original event signature. For a standard event signature, - `$Args[0]` represents the sender, and `$Args[1]` represents the **SourceEventArgs**. In the - value of the **Action** parameter, the `$Args` automatic variable contains this value. + `$args[0]` represents the sender, and `$args[1]` represents the **SourceEventArgs**. In the + value of the **Action** parameter, the `$args` automatic variable contains this value. - SourceIdentifier. A string that identifies the event subscription. In the value of the **Action** parameter, the **SourceIdentifier** property of the `$Event` automatic variable diff --git a/reference/7.4/Microsoft.PowerShell.Utility/New-Event.md b/reference/7.4/Microsoft.PowerShell.Utility/New-Event.md index 21d1cd71a4bc..fa24d99f4283 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/New-Event.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/New-Event.md @@ -59,7 +59,7 @@ PS C:\> function Enable-ProcessCreationEvent $Identifier = "WMI.ProcessCreated" Register-ObjectEvent $ProcessWatcher "EventArrived" -SupportEvent $Identifier -Action { - [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $Args[0] -EventArguments $Args[1].SourceEventArgs.NewEvent.TargetInstance) + [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $args[0] -EventArguments $args[1].SourceEventArgs.NewEvent.TargetInstance) } } ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 35b2702c918c..83697d20fb5e 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -160,7 +160,7 @@ instead of sending the event to the event queue. Enclose the commands in braces script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables, which provide information about the event to the +`$EventArgs`, and `$args` automatic variables, which provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index 4ab78563a0ae..6a85dec22c18 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -196,7 +196,7 @@ raised, instead of sending the event to the event queue. Enclose the commands in create a script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables. These variables provide information about the event +`$EventArgs`, and `$args` automatic variables. These variables provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). When you specify an action, `Register-ObjectEvent` returns an event job object that represents diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md index 0471022e86da..b1664577ecab 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -126,7 +126,7 @@ for the following automatic variables: ```powershell $_ -$Args +$args $Input $MyInvocation $PSBoundParameters @@ -144,7 +144,7 @@ variable. For example, ```powershell -$scriptArgs = $Args +$scriptArgs = $args $scriptname = $MyInvocation.PSCommandPath ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md index d2dce48e7c76..4a54c8e9ecbf 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md @@ -450,15 +450,15 @@ need to declare or enumerate the command parameters, or change the function when command parameters change. The following sample function calls the `Get-Command` cmdlet. The command uses -`@Args` to represent the parameters of `Get-Command`. +`@args` to represent the parameters of `Get-Command`. ```powershell -function Get-MyCommand { Get-Command @Args } +function Get-MyCommand { Get-Command @args } ``` You can use all the parameters of `Get-Command` when you call the `Get-MyCommand` function. The parameters and parameter values are passed to the -command using `@Args`. +command using `@args`. ```powershell Get-MyCommand -Name Get-ChildItem @@ -470,7 +470,7 @@ CommandType Name ModuleName Cmdlet Get-ChildItem Microsoft.PowerShell.Management ``` -The `@Args` feature uses the `$Args` automatic parameter, which represents +The `@args` feature uses the `$args` automatic parameter, which represents undeclared cmdlet parameters and values from remaining arguments. For more information, see [about_Splatting][19]. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 4e4d379158b4..66989f74ec48 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -23,7 +23,7 @@ When you use the `CmdletBinding` attribute, PowerShell automatically adds the Common Parameters. You can't create any parameters that use the same names as the Common Parameters. For more information, see [about_CommonParameters][06]. -Beginning in PowerShell 3.0, you can use splatting with `@Args` to represent +Beginning in PowerShell 3.0, you can use splatting with `@args` to represent the parameters in a command. Splatting is valid on simple and advanced functions. For more information, see [about_Functions][14] and [about_Splatting][17]. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index af4548ca1228..3ff4ea38a32a 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -25,7 +25,7 @@ the Common Parameters. For more information, see [about_CommonParameters][02]. PowerShell binds the parameters of functions that have the `CmdletBinding` attribute in the same way that it binds the parameters of compiled cmdlets. The `$PSCmdlet` automatic variable is available to functions with the -`CmdletBinding` attribute, but the `$Args` variable is not available. +`CmdletBinding` attribute, but the `$args` variable is not available. In functions that have the `CmdletBinding` attribute, unknown parameters and positional arguments that have no matching positional parameters cause diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md index 5f37d93d580a..427eb35781e1 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -301,22 +301,22 @@ You can use splatting to represent the parameters of a command. This technique is useful when you are creating a proxy function, that is, a function that calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent the command +To splat the parameters of a command, use `@args` to represent the command parameters. This technique is easier than enumerating command parameters and it works without revision even if the parameters of the called command change. -The feature uses the `$Args` automatic variable, which contains all unassigned +The feature uses the `$args` automatic variable, which contains all unassigned parameter values. For example, the following function calls the `Get-Process` cmdlet. In this -function, `@Args` represents all the parameters of the `Get-Process` cmdlet. +function, `@args` represents all the parameters of the `Get-Process` cmdlet. ```powershell -function Get-MyProcess { Get-Process @Args } +function Get-MyProcess { Get-Process @args } ``` When you use the `Get-MyProcess` function, all unassigned parameters and -parameter values are passed to `@Args`, as shown in the following commands. +parameter values are passed to `@args`, as shown in the following commands. ```powershell Get-MyProcess -Name PowerShell @@ -338,16 +338,16 @@ ProductVersion FileVersion FileName 6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly declared parameters. You +You can use `@args` in a function that has explicitly declared parameters. You can use it more than once in a function, but all parameters that you enter are -passed to all instances of `@Args`, as shown in the following example. +passed to all instances of `@args`, as shown in the following example. ```powershell function Get-MyCommand { Param ([switch]$P, [switch]$C) - if ($P) { Get-Process @Args } - if ($C) { Get-Command @Args } + if ($P) { Get-Process @args } + if ($C) { Get-Command @args } } Get-MyCommand -P -C -Name PowerShell diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Event.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Event.md index 5371dccb7364..7c1dea45e908 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Event.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Event.md @@ -188,8 +188,8 @@ The `Get-Event` cmdlet returns a **PSEventArgs** object automatic variable contains this value. - SourceArgs. All parameters of the original event signature. For a standard event signature, - `$Args[0]` represents the sender, and `$Args[1]` represents the **SourceEventArgs**. In the - value of the **Action** parameter, the `$Args` automatic variable contains this value. + `$args[0]` represents the sender, and `$args[1]` represents the **SourceEventArgs**. In the + value of the **Action** parameter, the `$args` automatic variable contains this value. - SourceIdentifier. A string that identifies the event subscription. In the value of the **Action** parameter, the **SourceIdentifier** property of the `$Event` automatic variable diff --git a/reference/7.5/Microsoft.PowerShell.Utility/New-Event.md b/reference/7.5/Microsoft.PowerShell.Utility/New-Event.md index 62a992e5c98f..e3279ff6e505 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/New-Event.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/New-Event.md @@ -59,7 +59,7 @@ PS C:\> function Enable-ProcessCreationEvent $Identifier = "WMI.ProcessCreated" Register-ObjectEvent $ProcessWatcher "EventArrived" -SupportEvent $Identifier -Action { - [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $Args[0] -EventArguments $Args[1].SourceEventArgs.NewEvent.TargetInstance) + [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $args[0] -EventArguments $args[1].SourceEventArgs.NewEvent.TargetInstance) } } ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md index a49ffd86caa7..12e18d7e3525 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -160,7 +160,7 @@ instead of sending the event to the event queue. Enclose the commands in braces script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables, which provide information about the event to the +`$EventArgs`, and `$args` automatic variables, which provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index e13e47035cc2..f8ff8d90659c 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -196,7 +196,7 @@ raised, instead of sending the event to the event queue. Enclose the commands in create a script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables. These variables provide information about the event +`$EventArgs`, and `$args` automatic variables. These variables provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). When you specify an action, `Register-ObjectEvent` returns an event job object that represents diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md index 7c097cfff68e..66b2fdf310dd 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -126,7 +126,7 @@ for the following automatic variables: ```powershell $_ -$Args +$args $Input $MyInvocation $PSBoundParameters @@ -144,7 +144,7 @@ variable. For example, ```powershell -$scriptArgs = $Args +$scriptArgs = $args $scriptname = $MyInvocation.PSCommandPath ``` diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md index 4b08f233aae5..468d4cef4a98 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md @@ -450,15 +450,15 @@ need to declare or enumerate the command parameters, or change the function when command parameters change. The following sample function calls the `Get-Command` cmdlet. The command uses -`@Args` to represent the parameters of `Get-Command`. +`@args` to represent the parameters of `Get-Command`. ```powershell -function Get-MyCommand { Get-Command @Args } +function Get-MyCommand { Get-Command @args } ``` You can use all the parameters of `Get-Command` when you call the `Get-MyCommand` function. The parameters and parameter values are passed to the -command using `@Args`. +command using `@args`. ```powershell Get-MyCommand -Name Get-ChildItem @@ -470,7 +470,7 @@ CommandType Name ModuleName Cmdlet Get-ChildItem Microsoft.PowerShell.Management ``` -The `@Args` feature uses the `$Args` automatic parameter, which represents +The `@args` feature uses the `$args` automatic parameter, which represents undeclared cmdlet parameters and values from remaining arguments. For more information, see [about_Splatting][19]. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 183396f1c445..456f8e8c50d9 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -23,7 +23,7 @@ When you use the `CmdletBinding` attribute, PowerShell automatically adds the Common Parameters. You can't create any parameters that use the same names as the Common Parameters. For more information, see [about_CommonParameters][06]. -Beginning in PowerShell 3.0, you can use splatting with `@Args` to represent +Beginning in PowerShell 3.0, you can use splatting with `@args` to represent the parameters in a command. Splatting is valid on simple and advanced functions. For more information, see [about_Functions][14] and [about_Splatting][17]. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 4f391863cc9a..bf6b156397c2 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -25,7 +25,7 @@ the Common Parameters. For more information, see [about_CommonParameters][02]. PowerShell binds the parameters of functions that have the `CmdletBinding` attribute in the same way that it binds the parameters of compiled cmdlets. The `$PSCmdlet` automatic variable is available to functions with the -`CmdletBinding` attribute, but the `$Args` variable is not available. +`CmdletBinding` attribute, but the `$args` variable is not available. In functions that have the `CmdletBinding` attribute, unknown parameters and positional arguments that have no matching positional parameters cause diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md index 1b7a93702c93..d7d0f3b3d1c7 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -301,22 +301,22 @@ You can use splatting to represent the parameters of a command. This technique is useful when you are creating a proxy function, that is, a function that calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent the command +To splat the parameters of a command, use `@args` to represent the command parameters. This technique is easier than enumerating command parameters and it works without revision even if the parameters of the called command change. -The feature uses the `$Args` automatic variable, which contains all unassigned +The feature uses the `$args` automatic variable, which contains all unassigned parameter values. For example, the following function calls the `Get-Process` cmdlet. In this -function, `@Args` represents all the parameters of the `Get-Process` cmdlet. +function, `@args` represents all the parameters of the `Get-Process` cmdlet. ```powershell -function Get-MyProcess { Get-Process @Args } +function Get-MyProcess { Get-Process @args } ``` When you use the `Get-MyProcess` function, all unassigned parameters and -parameter values are passed to `@Args`, as shown in the following commands. +parameter values are passed to `@args`, as shown in the following commands. ```powershell Get-MyProcess -Name PowerShell @@ -338,16 +338,16 @@ ProductVersion FileVersion FileName 6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly declared parameters. You +You can use `@args` in a function that has explicitly declared parameters. You can use it more than once in a function, but all parameters that you enter are -passed to all instances of `@Args`, as shown in the following example. +passed to all instances of `@args`, as shown in the following example. ```powershell function Get-MyCommand { Param ([switch]$P, [switch]$C) - if ($P) { Get-Process @Args } - if ($C) { Get-Command @Args } + if ($P) { Get-Process @args } + if ($C) { Get-Command @args } } Get-MyCommand -P -C -Name PowerShell diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Event.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Event.md index d2fa90528e81..2097b5487a40 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Event.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Event.md @@ -188,8 +188,8 @@ The `Get-Event` cmdlet returns a **PSEventArgs** object automatic variable contains this value. - SourceArgs. All parameters of the original event signature. For a standard event signature, - `$Args[0]` represents the sender, and `$Args[1]` represents the **SourceEventArgs**. In the - value of the **Action** parameter, the `$Args` automatic variable contains this value. + `$args[0]` represents the sender, and `$args[1]` represents the **SourceEventArgs**. In the + value of the **Action** parameter, the `$args` automatic variable contains this value. - SourceIdentifier. A string that identifies the event subscription. In the value of the **Action** parameter, the **SourceIdentifier** property of the `$Event` automatic variable diff --git a/reference/7.6/Microsoft.PowerShell.Utility/New-Event.md b/reference/7.6/Microsoft.PowerShell.Utility/New-Event.md index 379a066aa3fc..a22e00d56154 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/New-Event.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/New-Event.md @@ -59,7 +59,7 @@ PS C:\> function Enable-ProcessCreationEvent $Identifier = "WMI.ProcessCreated" Register-ObjectEvent $ProcessWatcher "EventArrived" -SupportEvent $Identifier -Action { - [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $Args[0] -EventArguments $Args[1].SourceEventArgs.NewEvent.TargetInstance) + [void] (New-Event -SourceID "PowerShell.ProcessCreated" -Sender $args[0] -EventArguments $args[1].SourceEventArgs.NewEvent.TargetInstance) } } ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 726080422b13..b167ca949e5d 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -160,7 +160,7 @@ instead of sending the event to the event queue. Enclose the commands in braces script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables, which provide information about the event to the +`$EventArgs`, and `$args` automatic variables, which provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index 5ffb160748ca..32ef5d7725a5 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -196,7 +196,7 @@ raised, instead of sending the event to the event queue. Enclose the commands in create a script block. The value of the **Action** parameter can include the `$Event`, `$EventSubscriber`, `$Sender`, -`$EventArgs`, and `$Args` automatic variables. These variables provide information about the event +`$EventArgs`, and `$args` automatic variables. These variables provide information about the event to the **Action** script block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). When you specify an action, `Register-ObjectEvent` returns an event job object that represents diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md index a793e6e084ca..13c4cd44c201 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md @@ -234,11 +234,11 @@ debugging a script. However, these methods do not work for the following automat - `$PSBoundParameters` -- `$Args` +- `$args` If you try to display the value of any of these variables, you get the value of that variable for in an internal pipeline the debugger uses, not the value of the variable in the script. You can work -around this for a few variables (`$_`, `$Input`, `$MyInvocation`, `$PSBoundParameters`, and `$Args`) +around this for a few variables (`$_`, `$Input`, `$MyInvocation`, `$PSBoundParameters`, and `$args`) by using the following method: 1. In the script, assign the value of the automatic variable to a new variable. From 1f28c5c9a9333dcf6d70e704f5202a59898c6343 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 24 Feb 2025 09:56:08 -0600 Subject: [PATCH 05/16] Fixes #11825 - Document the default edit mode (#11826) * Document the default edit mode * fix xrefs --- .../About/about_Line_Editing.md | 24 +++++++++++++----- .../5.1/PSReadLine/Set-PSReadLineOption.md | 6 ++--- .../About/about_Line_Editing.md | 25 ++++++++++++++----- .../7.4/PSReadLine/Set-PSReadLineOption.md | 8 +++--- .../About/about_Line_Editing.md | 25 ++++++++++++++----- .../7.5/PSReadLine/Set-PSReadLineOption.md | 6 ++--- .../About/about_Line_Editing.md | 25 ++++++++++++++----- .../7.6/PSReadLine/Set-PSReadLineOption.md | 6 ++--- 8 files changed, 88 insertions(+), 37 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Line_Editing.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Line_Editing.md index 1ad058b6b8f7..bd8f515e9d2a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Line_Editing.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Line_Editing.md @@ -1,7 +1,7 @@ --- description: Describes how to edit commands at the PowerShell command prompt. Locale: en-US -ms.date: 09/12/2022 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_line_editing?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Line_Editing @@ -15,8 +15,16 @@ Describes how to edit commands at the PowerShell command prompt. ## Long description -The PowerShell console has some useful keyboard shortcuts to help you edit -commands at the PowerShell command prompt. +The PSReadLine module provides useful keyboard shortcuts to help you edit +commands at the PowerShell command prompt. The key bindings discussed in this +article are the default key bindings on Windows platforms. You can create +custom key bindings by using the `Set-PSReadLineKeyHandler` command. + +You can change the edit mode using the `Set-PSReadLineOption` command. +PSReadLine has three edit modes: `Emacs`, `Vi`, and `Windows`. + +To see the current edit mode, use the `Get-PSReadLineOption` command. To see a +list of the current key bindings, use the `Get-PSReadLineKeyHandler` command. ### Add a line @@ -76,6 +84,10 @@ key. To scroll through a list of values, press the Tab key again. ## See also -- [about_Command_Syntax](about_Command_Syntax.md) -- [about_Path_Syntax](about_Path_Syntax.md) -- [about_PSReadline](../../PSReadline/About/about_PSReadline.md) +- [about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md) +- [about_Tab_Expansion](about_Tab_Expansion.md) +- [Get-PSReadLineOption](xref:PSReadLine.Get-PSReadLineOption) +- [Get-PSReadLineKeyHandler](xref:PSReadLine.Get-PSReadLineKeyHandler) +- [Set-PSReadLineOption](xref:PSReadLine.Set-PSReadLineOption) +- [Set-PSReadLineKeyHandler](xref:PSReadLine.Set-PSReadLineKeyHandler) +- [Using PSReadLine key handlers](/powershell/scripting/learn/shell/using-keyhandlers) diff --git a/reference/5.1/PSReadLine/Set-PSReadLineOption.md b/reference/5.1/PSReadLine/Set-PSReadLineOption.md index 14278f3fd145..2821f6c5a2f8 100644 --- a/reference/5.1/PSReadLine/Set-PSReadLineOption.md +++ b/reference/5.1/PSReadLine/Set-PSReadLineOption.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml Locale: en-US Module Name: PSReadLine -ms.date: 10/02/2023 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/set-psreadlineoption?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-PSReadLineOption @@ -443,7 +443,7 @@ Specifies the command line editing mode. Using this parameter resets any key bin The valid values are as follows: -- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. +- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. (default on Windows) - **Emacs**: Key bindings emulate Bash or Emacs. - **Vi**: Key bindings emulate Vi. @@ -492,7 +492,7 @@ commands are added to history to preserve ordering during recall. However, you t to see the command multiple times when recalling or searching the history. By default, the **HistoryNoDuplicates** property of the global **PSConsoleReadLineOptions** object -is set to `True`. To change the property value, you must specify the value of the +is set to `True`. To change the property value, you must specify the value of the **SwitchParameter** as follows: `-HistoryNoDuplicates:$False`. You can set back to `True` by using just the **SwitchParameter**, `-HistoryNoDuplicates`. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Line_Editing.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Line_Editing.md index 81d9fc8e99ec..bb1f19e62d47 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Line_Editing.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Line_Editing.md @@ -1,7 +1,7 @@ --- description: Describes how to edit commands at the PowerShell command prompt. Locale: en-US -ms.date: 09/12/2022 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_line_editing?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Line_Editing @@ -15,8 +15,17 @@ Describes how to edit commands at the PowerShell command prompt. ## Long description -The PowerShell console has some useful keyboard shortcuts to help you edit -commands at the PowerShell command prompt. +The PSReadLine module provides useful keyboard shortcuts to help you edit +commands at the PowerShell command prompt. The key bindings discussed in this +article are the default key bindings on Windows platforms. You can create +custom key bindings by using the `Set-PSReadLineKeyHandler` command. + +On non-Windows platforms, PSReadLine defaults to the `Emacs` edit mode. You can +change the edit mode using the `Set-PSReadLineOption` command. PSReadLine has +three edit modes: `Emacs`, `Vi`, and `Windows`. + +To see the current edit mode, use the `Get-PSReadLineOption` command. To see a +list of the current key bindings, use the `Get-PSReadLineKeyHandler` command. ### Add a line @@ -76,6 +85,10 @@ key. To scroll through a list of values, press the Tab key again. ## See also -- [about_Command_Syntax](about_Command_Syntax.md) -- [about_Path_Syntax](about_Path_Syntax.md) -- [about_PSReadline](../../PSReadline/About/about_PSReadline.md) +- [about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md) +- [about_Tab_Expansion](about_Tab_Expansion.md) +- [Get-PSReadLineOption](xref:PSReadLine.Get-PSReadLineOption) +- [Get-PSReadLineKeyHandler](xref:PSReadLine.Get-PSReadLineKeyHandler) +- [Set-PSReadLineOption](xref:PSReadLine.Set-PSReadLineOption) +- [Set-PSReadLineKeyHandler](xref:PSReadLine.Set-PSReadLineKeyHandler) +- [Using PSReadLine key handlers](/powershell/scripting/learn/shell/using-keyhandlers) diff --git a/reference/7.4/PSReadLine/Set-PSReadLineOption.md b/reference/7.4/PSReadLine/Set-PSReadLineOption.md index a6a6bc1e49df..9e03e5645823 100644 --- a/reference/7.4/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.4/PSReadLine/Set-PSReadLineOption.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml Locale: en-US Module Name: PSReadLine -ms.date: 10/10/2023 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/set-psreadlineoption?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-PSReadLineOption @@ -454,8 +454,8 @@ Specifies the command line editing mode. Using this parameter resets any key bin The valid values are as follows: -- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. -- **Emacs**: Key bindings emulate Bash or Emacs. +- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. (default on Windows) +- **Emacs**: Key bindings emulate Bash or Emacs. (default on non-Windows platforms) - **Vi**: Key bindings emulate Vi. Use `Get-PSReadLineKeyHandler` to see the key bindings for the currently configured **EditMode**. @@ -503,7 +503,7 @@ commands are added to history to preserve ordering during recall. However, you t to see the command multiple times when recalling or searching the history. By default, the **HistoryNoDuplicates** property of the global **PSConsoleReadLineOptions** object -is set to `True`. To change the property value, you must specify the value of the +is set to `True`. To change the property value, you must specify the value of the **SwitchParameter** as follows: `-HistoryNoDuplicates:$False`. You can set back to `True` by using just the **SwitchParameter**, `-HistoryNoDuplicates`. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Line_Editing.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Line_Editing.md index 9d7b8a40ed4d..d80a8b05ed59 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Line_Editing.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Line_Editing.md @@ -1,7 +1,7 @@ --- description: Describes how to edit commands at the PowerShell command prompt. Locale: en-US -ms.date: 09/12/2022 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_line_editing?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Line_Editing @@ -15,8 +15,17 @@ Describes how to edit commands at the PowerShell command prompt. ## Long description -The PowerShell console has some useful keyboard shortcuts to help you edit -commands at the PowerShell command prompt. +The PSReadLine module provides useful keyboard shortcuts to help you edit +commands at the PowerShell command prompt. The key bindings discussed in this +article are the default key bindings on Windows platforms. You can create +custom key bindings by using the `Set-PSReadLineKeyHandler` command. + +On non-Windows platforms, PSReadLine defaults to the `Emacs` edit mode. You can +change the edit mode using the `Set-PSReadLineOption` command. PSReadLine has +three edit modes: `Emacs`, `Vi`, and `Windows`. + +To see the current edit mode, use the `Get-PSReadLineOption` command. To see a +list of the current key bindings, use the `Get-PSReadLineKeyHandler` command. ### Add a line @@ -76,6 +85,10 @@ key. To scroll through a list of values, press the Tab key again. ## See also -- [about_Command_Syntax](about_Command_Syntax.md) -- [about_Path_Syntax](about_Path_Syntax.md) -- [about_PSReadLine](../../PSReadline/About/about_PSReadline.md) +- [about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md) +- [about_Tab_Expansion](about_Tab_Expansion.md) +- [Get-PSReadLineOption](xref:PSReadLine.Get-PSReadLineOption) +- [Get-PSReadLineKeyHandler](xref:PSReadLine.Get-PSReadLineKeyHandler) +- [Set-PSReadLineOption](xref:PSReadLine.Set-PSReadLineOption) +- [Set-PSReadLineKeyHandler](xref:PSReadLine.Set-PSReadLineKeyHandler) +- [Using PSReadLine key handlers](/powershell/scripting/learn/shell/using-keyhandlers) diff --git a/reference/7.5/PSReadLine/Set-PSReadLineOption.md b/reference/7.5/PSReadLine/Set-PSReadLineOption.md index 75a7b38973c9..c63130ea2ad6 100644 --- a/reference/7.5/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.5/PSReadLine/Set-PSReadLineOption.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml Locale: en-US Module Name: PSReadLine -ms.date: 10/10/2023 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/set-psreadlineoption?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-PSReadLineOption @@ -454,8 +454,8 @@ Specifies the command line editing mode. Using this parameter resets any key bin The valid values are as follows: -- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. -- **Emacs**: Key bindings emulate Bash or Emacs. +- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. (default on Windows) +- **Emacs**: Key bindings emulate Bash or Emacs. (default on non-Windows platforms) - **Vi**: Key bindings emulate Vi. Use `Get-PSReadLineKeyHandler` to see the key bindings for the currently configured **EditMode**. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Line_Editing.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Line_Editing.md index ca49ed8f651c..2a7e33f44d34 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Line_Editing.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Line_Editing.md @@ -1,7 +1,7 @@ --- description: Describes how to edit commands at the PowerShell command prompt. Locale: en-US -ms.date: 09/12/2022 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_line_editing?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Line_Editing @@ -15,8 +15,17 @@ Describes how to edit commands at the PowerShell command prompt. ## Long description -The PowerShell console has some useful keyboard shortcuts to help you edit -commands at the PowerShell command prompt. +The PSReadLine module provides useful keyboard shortcuts to help you edit +commands at the PowerShell command prompt. The key bindings discussed in this +article are the default key bindings on Windows platforms. You can create +custom key bindings by using the `Set-PSReadLineKeyHandler` command. + +On non-Windows platforms, PSReadLine defaults to the `Emacs` edit mode. You can +change the edit mode using the `Set-PSReadLineOption` command. PSReadLine has +three edit modes: `Emacs`, `Vi`, and `Windows`. + +To see the current edit mode, use the `Get-PSReadLineOption` command. To see a +list of the current key bindings, use the `Get-PSReadLineKeyHandler` command. ### Add a line @@ -76,6 +85,10 @@ key. To scroll through a list of values, press the Tab key again. ## See also -- [about_Command_Syntax](about_Command_Syntax.md) -- [about_Path_Syntax](about_Path_Syntax.md) -- [about_PSReadLine](../../PSReadline/About/about_PSReadline.md) +- [about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md) +- [about_Tab_Expansion](about_Tab_Expansion.md) +- [Get-PSReadLineOption](xref:PSReadLine.Get-PSReadLineOption) +- [Get-PSReadLineKeyHandler](xref:PSReadLine.Get-PSReadLineKeyHandler) +- [Set-PSReadLineOption](xref:PSReadLine.Set-PSReadLineOption) +- [Set-PSReadLineKeyHandler](xref:PSReadLine.Set-PSReadLineKeyHandler) +- [Using PSReadLine key handlers](/powershell/scripting/learn/shell/using-keyhandlers) diff --git a/reference/7.6/PSReadLine/Set-PSReadLineOption.md b/reference/7.6/PSReadLine/Set-PSReadLineOption.md index f425e56324f6..32e82a12f1e8 100644 --- a/reference/7.6/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.6/PSReadLine/Set-PSReadLineOption.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml Locale: en-US Module Name: PSReadLine -ms.date: 10/10/2023 +ms.date: 02/24/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/set-psreadlineoption?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-PSReadLineOption @@ -454,8 +454,8 @@ Specifies the command line editing mode. Using this parameter resets any key bin The valid values are as follows: -- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. -- **Emacs**: Key bindings emulate Bash or Emacs. +- **Windows**: Key bindings emulate PowerShell, cmd, and Visual Studio. (default on Windows) +- **Emacs**: Key bindings emulate Bash or Emacs. (default on non-Windows platforms) - **Vi**: Key bindings emulate Vi. Use `Get-PSReadLineKeyHandler` to see the key bindings for the currently configured **EditMode**. From e1056e3f5ad53325744c366b22ad3d495d1d0da6 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:29:59 +0000 Subject: [PATCH 06/16] Fix `$Error`, `$Event` and `$ExecutionContext` automatic variable case (2/13) (#11827) * Fix $Error automatic variable case * Fix $Event automatic variable case * Fix $ExecutionContext automatic variable case --- .../.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 | 4 ++-- .github/actions/.pwsh/module/readme.md | 2 +- reference/5.1/CimCmdlets/Register-CimIndicationEvent.md | 6 +++--- .../About/about_CommonParameters.md | 2 +- .../5.1/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/About/about_Scripts.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- reference/7.4/CimCmdlets/Register-CimIndicationEvent.md | 6 +++--- .../About/about_CommonParameters.md | 2 +- .../7.4/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/About/about_Scripts.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- reference/7.5/CimCmdlets/Register-CimIndicationEvent.md | 6 +++--- .../About/about_CommonParameters.md | 2 +- .../7.5/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/About/about_Scripts.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- reference/7.6/CimCmdlets/Register-CimIndicationEvent.md | 6 +++--- .../About/about_CommonParameters.md | 2 +- .../7.6/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/About/about_Scripts.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- 22 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 b/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 index d7fcc0fabf2d..51b37446f8b3 100644 --- a/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 +++ b/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 @@ -6,7 +6,7 @@ properties to the fully qualified ID, the type of the error, the error message, and the target object (which for GH CLI errors is always the command-line arguments for the failing command). - It can retrieve errors from the `$error` variable or act on an input object. + It can retrieve errors from the `$Error` variable or act on an input object. .PARAMETER Newest Specifies the number of error records to return, from newest to oldest. .PARAMETER InputObject @@ -19,7 +19,7 @@ The cmdlet gets the alternate view for the last error in the session. .EXAMPLE ```powershell - Get-GHAConsoleError -InputObject $error[0] + Get-GHAConsoleError -InputObject $Error[0] ``` The cmdlet gets the alternate view for the last error in the session. diff --git a/.github/actions/.pwsh/module/readme.md b/.github/actions/.pwsh/module/readme.md index f6466fd6957e..996fa40c58d7 100644 --- a/.github/actions/.pwsh/module/readme.md +++ b/.github/actions/.pwsh/module/readme.md @@ -78,7 +78,7 @@ This cmdlet returns an alternate view of an error record for the GH CLI. It limi properties to the fully qualified ID, the type of the error, the error message, and the target object (which for GH CLI errors is always the command-line arguments for the failing command). -It can retrieve errors from the `$error` variable or act on an input object. +It can retrieve errors from the `$Error` variable or act on an input object. For more information, review the [source code][utility-Get-GHAConsoleError] diff --git a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md index d619ecd815d6..b8d5e37c204d 100644 --- a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md @@ -94,12 +94,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer" ### Example 3: Run a script when the event arrives This example shows how to use an action in response to an event. The variable `$action` holds the -script block for **Action**, which uses the `$event` variable to access the event received from CIM. +script block for **Action**, which uses the `$Event` variable to access the event received from CIM. ```powershell $action = { - $name = $event.SourceEventArgs.NewEvent.ProcessName - $id = $event.SourceEventArgs.NewEvent.ProcessId + $name = $Event.SourceEventArgs.NewEvent.ProcessName + $id = $Event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } $event = @{ diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 65c5a4abfd5b..69316a926fbf 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -202,7 +202,7 @@ You can use this parameter to create a variable that contains only error messages from specific commands and doesn't affect the behavior of the `$Error` automatic variable. The `$Error` automatic variable contains error messages from all the commands in the session. You can use array notation, such as -`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables. +`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables. > [!NOTE] > The custom error variable contains all errors generated by the command, diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md index 7729bd81989b..c9968ac1626f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -73,7 +73,7 @@ For example: ``` ```Output -"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -114,7 +114,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md index 9e6b514c8818..f17e85c8367a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a param ($ComputerName = $(throw "ComputerName parameter is required.")) function CanPing { - $error.Clear() + $Error.Clear() $tmp = Test-Connection $computername -ErrorAction SilentlyContinue if (!$?) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 501f2dd1849d..27115530b31c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -81,7 +81,7 @@ data to a text file. ```powershell Register-EngineEvent -SourceIdentifier MyEventSource -Action { - "Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append + "Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append } Start-Job -Name TestJob -ScriptBlock { diff --git a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md index 575d23798867..db58a3c53c3a 100644 --- a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md @@ -96,12 +96,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer" ### Example 3: Run a script when the event arrives This example shows how to use an action in response to an event. The variable `$action` holds the -script block for **Action**, which uses the `$event` variable to access the event received from CIM. +script block for **Action**, which uses the `$Event` variable to access the event received from CIM. ```powershell $action = { - $name = $event.SourceEventArgs.NewEvent.ProcessName - $id = $event.SourceEventArgs.NewEvent.ProcessId + $name = $Event.SourceEventArgs.NewEvent.ProcessName + $id = $Event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } $event = @{ diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 776abbac7231..6c321880ff3f 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -196,7 +196,7 @@ You can use this parameter to create a variable that contains only error messages from specific commands and doesn't affect the behavior of the `$Error` automatic variable. The `$Error` automatic variable contains error messages from all the commands in the session. You can use array notation, such as -`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables. +`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables. > [!NOTE] > The custom error variable contains all errors generated by the command, diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md index 351b10b2f831..930f9f8b3b5a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -73,7 +73,7 @@ For example: ``` ```Output -"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -114,7 +114,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md index 3301c8a4bb41..2fa5f7f8fc26 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a param ($ComputerName = $(throw "ComputerName parameter is required.")) function CanPing { - $error.Clear() + $Error.Clear() $tmp = Test-Connection $computername -ErrorAction SilentlyContinue if (!$?) diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 83697d20fb5e..b5494d928904 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -81,7 +81,7 @@ data to a text file. ```powershell Register-EngineEvent -SourceIdentifier MyEventSource -Action { - "Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append + "Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append } Start-Job -Name TestJob -ScriptBlock { diff --git a/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md index 46816b9697dc..6f50cec7c223 100644 --- a/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md @@ -96,12 +96,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer" ### Example 3: Run a script when the event arrives This example shows how to use an action in response to an event. The variable `$action` holds the -script block for **Action**, which uses the `$event` variable to access the event received from CIM. +script block for **Action**, which uses the `$Event` variable to access the event received from CIM. ```powershell $action = { - $name = $event.SourceEventArgs.NewEvent.ProcessName - $id = $event.SourceEventArgs.NewEvent.ProcessId + $name = $Event.SourceEventArgs.NewEvent.ProcessName + $id = $Event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } $event = @{ diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 496f77769b7e..0585d21ae183 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -196,7 +196,7 @@ You can use this parameter to create a variable that contains only error messages from specific commands and doesn't affect the behavior of the `$Error` automatic variable. The `$Error` automatic variable contains error messages from all the commands in the session. You can use array notation, such as -`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables. +`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables. > [!NOTE] > The custom error variable contains all errors generated by the command, diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md index b161092d528e..85412ae8ab71 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -74,7 +74,7 @@ For example: ``` ```Output -"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -115,7 +115,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md index c626ce066773..67103599e6a2 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a param ($ComputerName = $(throw "ComputerName parameter is required.")) function CanPing { - $error.Clear() + $Error.Clear() $tmp = Test-Connection $computername -ErrorAction SilentlyContinue if (!$?) diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 12e18d7e3525..de8cb7653af1 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -81,7 +81,7 @@ data to a text file. ```powershell Register-EngineEvent -SourceIdentifier MyEventSource -Action { - "Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append + "Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append } Start-Job -Name TestJob -ScriptBlock { diff --git a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md index 379be06226e4..758b2eaa61b8 100644 --- a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md @@ -96,12 +96,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer" ### Example 3: Run a script when the event arrives This example shows how to use an action in response to an event. The variable `$action` holds the -script block for **Action**, which uses the `$event` variable to access the event received from CIM. +script block for **Action**, which uses the `$Event` variable to access the event received from CIM. ```powershell $action = { - $name = $event.SourceEventArgs.NewEvent.ProcessName - $id = $event.SourceEventArgs.NewEvent.ProcessId + $name = $Event.SourceEventArgs.NewEvent.ProcessName + $id = $Event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } $event = @{ diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 6ec72eda5175..1cc73dd2daaa 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -196,7 +196,7 @@ You can use this parameter to create a variable that contains only error messages from specific commands and doesn't affect the behavior of the `$Error` automatic variable. The `$Error` automatic variable contains error messages from all the commands in the session. You can use array notation, such as -`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables. +`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables. > [!NOTE] > The custom error variable contains all errors generated by the command, diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md index 49f0051644de..ebeb1691f192 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -74,7 +74,7 @@ For example: ``` ```Output -"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -115,7 +115,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md index 995a850a8937..1e69a5aea97b 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a param ($ComputerName = $(throw "ComputerName parameter is required.")) function CanPing { - $error.Clear() + $Error.Clear() $tmp = Test-Connection $computername -ErrorAction SilentlyContinue if (!$?) diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md index b167ca949e5d..a496520bc10c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -81,7 +81,7 @@ data to a text file. ```powershell Register-EngineEvent -SourceIdentifier MyEventSource -Action { - "Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append + "Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append } Start-Job -Name TestJob -ScriptBlock { From 091cb9571953b0f60c3e18c00b0cb2c4a1d75b0c Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:09:50 +0000 Subject: [PATCH 07/16] Fix $false automatic variable case (#11828) --- .../About/about_Data_Sections.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../About/about_Language_Modes.md | 2 +- .../About/about_Preference_Variables.md | 6 +++--- .../About/about_Properties.md | 2 +- .../About/about_Splatting.md | 2 +- .../5.1/Microsoft.PowerShell.Core/Get-Job.md | 6 +++--- .../New-PSSessionConfigurationFile.md | 2 +- .../Test-ModuleManifest.md | 4 ++-- .../Test-PSSessionConfigurationFile.md | 2 +- .../Microsoft.PowerShell.Core/Update-Help.md | 2 +- .../Microsoft.PowerShell.Core/Where-Object.md | 4 ++-- .../Split-Path.md | 4 ++-- .../Test-ComputerSecureChannel.md | 4 ++-- .../Test-Connection.md | 4 ++-- .../Invoke-OperationValidation.md | 2 +- .../Sort-Object.md | 2 +- .../Update-TypeData.md | 4 ++-- .../Wait-Event.md | 2 +- .../5.1/PSReadLine/Set-PSReadLineOption.md | 20 +++++++++---------- .../5.1/PSScheduledJob/Disable-JobTrigger.md | 2 +- .../PSScheduledJob/New-ScheduledJobOption.md | 2 +- .../PSScheduledJob/Register-ScheduledJob.md | 2 +- .../5.1/PSScheduledJob/Set-ScheduledJob.md | 2 +- .../About/about_ActivityCommonParameters.md | 12 +++++------ .../About/about_WorkflowCommonParameters.md | 2 +- .../About/about_Data_Sections.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../About/about_Language_Modes.md | 2 +- .../About/about_Properties.md | 2 +- .../About/about_Pwsh.md | 2 +- .../About/about_Splatting.md | 2 +- .../7.4/Microsoft.PowerShell.Core/Get-Job.md | 6 +++--- .../New-PSSessionConfigurationFile.md | 2 +- .../Test-ModuleManifest.md | 4 ++-- .../Test-PSSessionConfigurationFile.md | 2 +- .../Microsoft.PowerShell.Core/Update-Help.md | 2 +- .../Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../Split-Path.md | 4 ++-- .../Test-Connection.md | 6 +++--- .../Sort-Object.md | 2 +- .../Update-TypeData.md | 4 ++-- .../Wait-Event.md | 2 +- .../7.4/PSReadLine/Set-PSReadLineOption.md | 20 +++++++++---------- .../About/about_Data_Sections.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../About/about_Language_Modes.md | 2 +- .../About/about_Properties.md | 2 +- .../About/about_Pwsh.md | 2 +- .../About/about_Splatting.md | 2 +- .../7.5/Microsoft.PowerShell.Core/Get-Job.md | 6 +++--- .../New-PSSessionConfigurationFile.md | 2 +- .../Test-ModuleManifest.md | 4 ++-- .../Test-PSSessionConfigurationFile.md | 2 +- .../Microsoft.PowerShell.Core/Update-Help.md | 2 +- .../Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../Split-Path.md | 4 ++-- .../Test-Connection.md | 6 +++--- .../Sort-Object.md | 2 +- .../Update-TypeData.md | 4 ++-- .../Wait-Event.md | 2 +- .../7.5/PSReadLine/Set-PSReadLineOption.md | 20 +++++++++---------- .../About/about_Data_Sections.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../about_Functions_Advanced_Parameters.md | 2 +- .../about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../About/about_Language_Modes.md | 2 +- .../About/about_Properties.md | 2 +- .../About/about_Pwsh.md | 2 +- .../About/about_Splatting.md | 2 +- .../7.6/Microsoft.PowerShell.Core/Get-Job.md | 6 +++--- .../New-PSSessionConfigurationFile.md | 2 +- .../Test-ModuleManifest.md | 4 ++-- .../Test-PSSessionConfigurationFile.md | 2 +- .../Microsoft.PowerShell.Core/Update-Help.md | 2 +- .../Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../Split-Path.md | 4 ++-- .../Test-Connection.md | 6 +++--- .../Sort-Object.md | 2 +- .../Update-TypeData.md | 4 ++-- .../Wait-Event.md | 2 +- .../7.6/PSReadLine/Set-PSReadLineOption.md | 20 +++++++++---------- 92 files changed, 172 insertions(+), 172 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 2587d906833c..599ac334c78e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -47,7 +47,7 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements - The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$False`, and `$Null` + `$false`, and `$Null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index 24df354cb822..73fdadff63c2 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -582,7 +582,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ Returns `$True` when the `LastWriteTime` value of a file is greater than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet returns, or a string that can be converted to a **DateTime** object, such as @@ -595,7 +595,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ Returns `$True` when the `LastWriteTime` value of a file is less than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet returns, or a string that can be converted to a [DateTime][01] object, such as diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 7472da20db6f..e158f0b572e0 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -413,7 +413,7 @@ parameter is used in a command. By default, all function parameters are positional. PowerShell assigns position numbers to parameters in the order the parameters are declared in the function. To disable this feature, set the value of the `PositionalBinding` argument of -the **CmdletBinding** attribute to `$False`. The `Position` argument takes +the **CmdletBinding** attribute to `$false`. The `Position` argument takes precedence over the value of the `PositionalBinding` argument of the **CmdletBinding** attribute. For more information, see `PositionalBinding` in [about_Functions_CmdletBindingAttribute][12]. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 1228aefab39c..a07dd10a2c5f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -175,7 +175,7 @@ lists the changes that the command would make, instead of running the command. The **PositionalBinding** argument determines whether parameters in the function are positional by default. The default value is `$True`. You can use -the **PositionalBinding** argument with a value of `$False` to disable +the **PositionalBinding** argument with a value of `$false` to disable positional binding. The **PositionalBinding** argument is introduced in Windows PowerShell 3.0. @@ -192,7 +192,7 @@ When **PositionalBinding** is `$True`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. -When **PositionalBinding** is `$False`, function parameters are not positional +When **PositionalBinding** is `$false`, function parameters are not positional by default. Unless the **Position** argument of the **Parameter** attribute is declared on the parameter, the parameter name (or an alias or abbreviation) must be included when the parameter is used in a function. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index 46fdf3cf253a..56cd9644a628 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -67,7 +67,7 @@ any PowerShell modules. If this policy setting isn't configured, the **LogPipelineExecutionDetails** property of each module determines whether PowerShell logs the execution events of that module. By default, the **LogPipelineExecutionDetails** property of all -modules is set to `$False`. +modules is set to `$false`. To turn on module logging for a module, use the following command format. The module must be imported into the session and the setting is effective only in diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 8e32fe129626..463f8966245a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -167,7 +167,7 @@ mode: - `$PSCulture` - `$PSUICulture` - `$True` -- `$False` +- `$false` - `$Null` Module manifests are loaded in `RestrictedLanguage` mode and may use these diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index b1e2c22773d2..4c8e3e042582 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -32,8 +32,8 @@ The following table lists the preference variables and their default values. | [`$ErrorView`][05] | [`NormalView`][57] | | [`$FormatEnumerationLimit`][06] | `4` | | [`$InformationPreference`][07] | [`SilentlyContinue`][54] | -| [`$LogCommandHealthEvent`][08] | `$False` (not logged) | -| [`$LogCommandLifecycleEvent`][08] | `$False` (not logged) | +| [`$LogCommandHealthEvent`][08] | `$false` (not logged) | +| [`$LogCommandLifecycleEvent`][08] | `$false` (not logged) | | [`$LogEngineHealthEvent`][08] | `$True` (logged) | | [`$LogEngineLifecycleEvent`][08] | `$True` (logged) | | [`$LogProviderLifecycleEvent`][08] | `$True` (logged) | @@ -56,7 +56,7 @@ The following table lists the preference variables and their default values. | [`$Transcript`][24] | `$Null` (none) | | [`$VerbosePreference`][25] | [`SilentlyContinue`][54] | | [`$WarningPreference`][26] | [`Continue`][54] | -| [`$WhatIfPreference`][27] | `$False` | +| [`$WhatIfPreference`][27] | `$false` | PowerShell includes the following environment variables that store user preferences. For more information about these environment variables, see diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md index 2a8bda5c9234..630cc0db09af 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$False` if +that contains `$True` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md index eba820886ca3..6e430e8e262f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -70,7 +70,7 @@ variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. To provide a value for the **WhatIf** switch parameter, use `$True` or -`$False`. +`$false`. ```powershell $HashArguments = @{ diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md index 46f8b98a6890..311f17db9e94 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md @@ -548,13 +548,13 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not -have more results, specify a value of `$False`. +have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. When you use the `Receive-Job` cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it -sets the value of the **HasMoreData** property of the job to `$False`) to indicate that it has no +sets the value of the **HasMoreData** property of the job to `$false`) to indicate that it has no more results for the job in the current session. Use the **Keep** parameter of `Receive-Job` to prevent `Receive-Job` from deleting results and changing the value of the **HasMoreData** property. For more information, type `Get-Help Receive-Job`. @@ -562,7 +562,7 @@ For more information, type `Get-Help Receive-Job`. The **HasMoreData** property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the `Receive-Job` cmdlet in a different session to get the job results again, even if -the value of **HasMoreData** is `$False`. For more information, see the help topics for the custom +the value of **HasMoreData** is `$false`. For more information, see the help topics for the custom job type. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index 42983c5a48b6..3f4cea9c24b7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -583,7 +583,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$False`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 60c249e8672c..420cba51cdfd 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -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 d9e5e0cfaedf..21df1ae3e5f2 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/Update-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md index 43edc7de235e..e272f2f1b84c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md @@ -245,7 +245,7 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 Param( - [parameter(Mandatory=$False)] + [parameter(Mandatory=$false)] [String[]] $Module ) diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index 1bc5c62b34a6..a883886c4127 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -366,11 +366,11 @@ Get-ChildItem | Where-Object { $_.PSIsContainer } ```powershell # Finally, use the -not operator (!) to get objects that are not containers. # This gets objects that do have the **PSIsContainer** property and those -# that have a value of $False for the **PSIsContainer** property. +# that have a value of $false for the **PSIsContainer** property. Get-ChildItem | Where-Object { !$_.PSIsContainer } # You cannot use the -not operator (!) in the comparison statement format # of the command. -Get-ChildItem | Where-Object PSIsContainer -eq $False +Get-ChildItem | Where-Object PSIsContainer -eq $false ``` ### Example 6: Use multiple conditions diff --git a/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md index 5b041e8a7f10..d18302ddff98 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Split-Path.md @@ -132,7 +132,7 @@ the full path of the parent container. ### Example 4: Determines whether a path is absolute This command determines whether the path is relative or absolute. In this case, because the path is -relative to the current folder, which is represented by a dot (`.`), it returns `$False`. +relative to the current folder, which is represented by a dot (`.`), it returns `$false`. ```powershell Split-Path -Path ".\My Pictures\*.jpg" -IsAbsolute @@ -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/Test-ComputerSecureChannel.md b/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md index a645695f6540..b2352f510e6f 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md @@ -27,7 +27,7 @@ The `Test-ComputerSecureChannel` cmdlet verifies that the channel between the lo domain is working correctly by checking the status of its trust relationships. If a connection fails, you can use the **Repair** parameter to try to restore it. -`Test-ComputerSecureChannel` returns $True if the channel is working correctly and $False if it is +`Test-ComputerSecureChannel` returns $True if the channel is working correctly and $false if it is not. This result lets you use the cmdlet in conditional statements in functions and scripts. To get more detailed test results, use the **Verbose** parameter. @@ -200,7 +200,7 @@ You cannot pipe input to this cmdlet. ### System.Boolean -This cmdlet returns `$True` if the connection is working correctly and `$False` if it is not. +This cmdlet returns `$True` if the connection is working correctly and `$false` if it is not. ## NOTES diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md b/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md index a3d308e46235..bda00f0b8d60 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md @@ -153,7 +153,7 @@ 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` cmdlet to create the **PSSession**. @@ -359,7 +359,7 @@ specifies multiple computers, an array of **Boolean** values is returned. If **any** ping succeeds, `$True` is returned. -If **all** pings fail, `$False` is returned. +If **all** pings fail, `$false` is returned. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Operation.Validation/Invoke-OperationValidation.md b/reference/5.1/Microsoft.PowerShell.Operation.Validation/Invoke-OperationValidation.md index cd2b12ef621e..c30077b7cc18 100644 --- a/reference/5.1/Microsoft.PowerShell.Operation.Validation/Invoke-OperationValidation.md +++ b/reference/5.1/Microsoft.PowerShell.Operation.Validation/Invoke-OperationValidation.md @@ -84,7 +84,7 @@ pass it to the `Invoke-OperationValidation` cmdlet, which runs the test. ### -IncludePesterOutput -Includes Pester test output. The default is `$False`. +Includes Pester test output. The default is `$false`. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md index b0bea9425301..4624edb0a90a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md @@ -191,7 +191,7 @@ two properties, **Status** in descending order and **DisplayName** in ascending **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed -before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$False` to sort +before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. ### Example 6: Sort text files by time span diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md index 4591a7d390fe..36c64789ee6a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -495,11 +495,11 @@ Indicates whether the set of properties that are serialized is inherited. The de `$Null`. The acceptable values for this parameter are: - `$True`. The property set is inherited. -- `$False`. The property set is not inherited. +- `$false`. The property set is not inherited. - `$Null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is -`SpecificProperties`. When the value of this parameter is `$False`, the **PropertySerializationSet** +`SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** parameter is required. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md index fde22d2d6dea..13a7284d1fe0 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md @@ -62,7 +62,7 @@ $objectEventArgs = @{ } Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 -$Timer.Autoreset = $False +$Timer.Autoreset = $false $Timer.Enabled = $True Wait-Event Timer.Elapsed ``` diff --git a/reference/5.1/PSReadLine/Set-PSReadLineOption.md b/reference/5.1/PSReadLine/Set-PSReadLineOption.md index 2821f6c5a2f8..a25224bb7195 100644 --- a/reference/5.1/PSReadLine/Set-PSReadLineOption.md +++ b/reference/5.1/PSReadLine/Set-PSReadLineOption.md @@ -493,12 +493,12 @@ to see the command multiple times when recalling or searching the history. By default, the **HistoryNoDuplicates** property of the global **PSConsoleReadLineOptions** object is set to `True`. To change the property value, you must specify the value of the -**SwitchParameter** as follows: `-HistoryNoDuplicates:$False`. You can set back to `True` by using +**SwitchParameter** as follows: `-HistoryNoDuplicates:$false`. You can set back to `True` by using just the **SwitchParameter**, `-HistoryNoDuplicates`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistoryNoDuplicates = $False` +`(Get-PSReadLineOption).HistoryNoDuplicates = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -569,11 +569,11 @@ Specifies that history searching is case-sensitive in functions like **ReverseSe By default, the **HistorySearchCaseSensitive** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** sets the property value to `True`. To change the property value back, you must specify the value of the **SwitchParameter** as follows: -`-HistorySearchCaseSensitive:$False`. +`-HistorySearchCaseSensitive:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCaseSensitive = $False` +`(Get-PSReadLineOption).HistorySearchCaseSensitive = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -590,17 +590,17 @@ Accept wildcard characters: False ### -HistorySearchCursorMovesToEnd Indicates that the cursor moves to the end of commands that you load from history by using a search. -When this parameter is set to `$False`, the cursor remains at the position it was when you pressed +When this parameter is set to `$false`, the cursor remains at the position it was when you pressed the up or down arrows. By default, the **HistorySearchCursorMovesToEnd** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** set the property value to `True`. To change the property value back, you must specify the value of the -**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$False`. +**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $False` +`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -677,15 +677,15 @@ Accept wildcard characters: False When displaying possible completions, tooltips are shown in the list of completions. This option is enabled by default. This option wasn't enabled by default in prior versions of -**PSReadLine**. To disable, set this option to `$False`. +**PSReadLine**. To disable, set this option to `$false`. By default, the **ShowToolTips** property of the global **PSConsoleReadLineOptions** object is set to `True`. Using this **SwitchParameter** sets the property value to `True`. To change the property -value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$False`. +value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).ShowToolTips = $False` +`(Get-PSReadLineOption).ShowToolTips = $false` ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/PSScheduledJob/Disable-JobTrigger.md b/reference/5.1/PSScheduledJob/Disable-JobTrigger.md index b5ef2996a623..cc0af8776e34 100644 --- a/reference/5.1/PSScheduledJob/Disable-JobTrigger.md +++ b/reference/5.1/PSScheduledJob/Disable-JobTrigger.md @@ -29,7 +29,7 @@ To use this cmdlet, use the `Get-JobTrigger` cmdlet to get the job triggers. The triggers to `Disable-JobTrigger` or use its **InputObject** parameter. To disable a job trigger, the `Disable-JobTrigger` cmdlet sets the Enabled property of the job -trigger to `$False`. To re-enable the job trigger, use the `Enable-JobTrigger` cmdlet, which sets +trigger to `$false`. To re-enable the job trigger, use the `Enable-JobTrigger` cmdlet, which sets the **Enabled** property of the job trigger to $True. Disabling a job trigger does not disable the scheduled job, such as is done by the `Disable-ScheduledJob` cmdlet, but if you disable all job triggers, the effect is the same as disabling the scheduled job. diff --git a/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md b/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md index 2735ef78c48a..0fdf4bf41ce6 100644 --- a/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md +++ b/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md @@ -500,7 +500,7 @@ This cmdlet returns a **ScheduledJobOptions** object representing the created op **ScheduledJobOption** parameter can also take a hash table value that specifies the properties of the **ScheduledJobOptions** object and their values, such as: - `@{ShowInTaskScheduler=$False; RunElevated=$True; IdleDuration="00:05"}` + `@{ShowInTaskScheduler=$false; RunElevated=$True; IdleDuration="00:05"}` ## RELATED LINKS diff --git a/reference/5.1/PSScheduledJob/Register-ScheduledJob.md b/reference/5.1/PSScheduledJob/Register-ScheduledJob.md index e49f1d688199..5d44bc292025 100644 --- a/reference/5.1/PSScheduledJob/Register-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Register-ScheduledJob.md @@ -464,7 +464,7 @@ options, including the default values, see `New-ScheduledJobOption`. To submit a hash table, use the following keys. In the following hash table, the keys are shown with their default values. -`@{StartIfOnBattery=$False; StopIfGoingOnBattery=$True; WakeToRun=$False; StartIfNotIdle=$False; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$True; RestartOnIdleResume=$False; ShowInTaskScheduler=$True; RunElevated=$False; RunWithoutNetwork=$False; DoNotAllowDemandStart=$False; MultipleInstancePolicy="IgnoreNew"}` +`@{StartIfOnBattery=$false; StopIfGoingOnBattery=$True; WakeToRun=$false; StartIfNotIdle=$false; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$True; RestartOnIdleResume=$false; ShowInTaskScheduler=$True; RunElevated=$false; RunWithoutNetwork=$false; DoNotAllowDemandStart=$false; MultipleInstancePolicy="IgnoreNew"}` ```yaml Type: Microsoft.PowerShell.ScheduledJob.ScheduledJobOptions diff --git a/reference/5.1/PSScheduledJob/Set-ScheduledJob.md b/reference/5.1/PSScheduledJob/Set-ScheduledJob.md index 0d54fbe827a2..d752adf705ee 100644 --- a/reference/5.1/PSScheduledJob/Set-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Set-ScheduledJob.md @@ -443,7 +443,7 @@ options, including the default values, see `New-ScheduledJobOption`. To submit a hash table, use the following keys. In the following hash table, the keys are shown with their default values. -`@{# Power SettingsStartIfOnBattery=$False;StopIfGoingOnBattery=$True; WakeToRun=$False; # Idle SettingsStartIfNotIdle=$False; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$True; RestartOnIdleResume=$False;# Security settingsShowInTaskScheduler=$TrueRunElevated=$False;# MiscRunWithoutNetwork=$False;DoNotAllowDemandStart=$False;MultipleInstancePolicy=IgnoreNew# Can be IgnoreNew, Parallel, Queue, StopExisting}` +`@{# Power SettingsStartIfOnBattery=$false;StopIfGoingOnBattery=$True; WakeToRun=$false; # Idle SettingsStartIfNotIdle=$false; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$True; RestartOnIdleResume=$false;# Security settingsShowInTaskScheduler=$TrueRunElevated=$false;# MiscRunWithoutNetwork=$false;DoNotAllowDemandStart=$false;MultipleInstancePolicy=IgnoreNew# Can be IgnoreNew, Parallel, Queue, StopExisting}` ```yaml Type: Microsoft.PowerShell.ScheduledJob.ScheduledJobOptions diff --git a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md index db13a7813c00..986dac8d2690 100644 --- a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md @@ -65,7 +65,7 @@ This section describes the activity common parameters. #### AppendOutput \ A value of `$True` adds the output of the activity to the value of the variable. -A value of `$False` has no effect. By default, assigning a value to a variable +A value of `$false` has no effect. By default, assigning a value to a variable replaces the variable value. For example, the following commands add a process object to the service object @@ -144,7 +144,7 @@ piping objects to the activity one at a time. #### MergeErrorToOutput \ -A value of `$True` adds errors to the output stream. A value of `$False` has +A value of `$True` adds errors to the output stream. A value of `$false` has no effect. Use this parameter with the **Parallel** and `ForEach -Parallel` keywords to collect errors and output from multiple parallel commands in a single collection. @@ -170,7 +170,7 @@ affected target computer. #### PSAllowRedirection \ A value of `$True` allows redirection of the connection to the target computers. -A value of `$False` has no effect. This activity common parameter is also a +A value of `$false` has no effect. This activity common parameter is also a workflow common parameter. When you use the **PSConnectionURI** parameter, the remote destination can return @@ -365,7 +365,7 @@ Valid values: - `$True`. Directs all activities within a workflow to return "live" (not serialized) objects. The resulting objects have methods, as well as properties, but they cannot be saved when a checkpoint is taken. -- `$False`. Workflow objects are serialized. +- `$false`. Workflow objects are serialized. #### PSError \ @@ -414,7 +414,7 @@ Valid values: - `$True`. Takes a checkpoint after the activity completes. This checkpoint is in addition to any checkpoints that are specified in the workflow. -- `$False`. No checkpoints are added. Checkpoints are taken only when specified +- `$false`. No checkpoints are added. Checkpoints are taken only when specified in the workflow. #### PSPort \ @@ -501,7 +501,7 @@ For more information about the `$PSSessionOption` preference variable, see A value of `$True` uses the Secure Sockets Layer (SSL) protocol to establish a connection to the target computer. By default, SSL is not used. A value of -`$False` has no effect. This activity common parameter is also a workflow common +`$false` has no effect. This activity common parameter is also a workflow common parameter. WS-Management encrypts all Windows PowerShell content transmitted over the diff --git a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md index b202749ade6c..337fc6bdcde4 100644 --- a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -292,7 +292,7 @@ Valid values: checkpoint after each activity, in addition to any checkpoints that are specified in the workflow. -- `$False`. No checkpoints are added. Checkpoints are taken only when specified +- `$false`. No checkpoints are added. Checkpoints are taken only when specified in the workflow. #### -PSPort \ diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md index b8781e3e0028..31d497f941d6 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -47,7 +47,7 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements - The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$False`, and `$Null` + `$false`, and `$Null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index af99028ec811..e24d00fc326a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -587,7 +587,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ Returns `$True` when the `LastWriteTime` value of a file is greater than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet returns, or a string that can be converted to a **DateTime** object, such as @@ -600,7 +600,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ Returns `$True` when the `LastWriteTime` value of a file is less than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet returns, or a string that can be converted to a [DateTime][01] object, such as diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index b3aac9fa1c76..f4b3eee75709 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -408,7 +408,7 @@ parameter is used in a command. By default, all function parameters are positional. PowerShell assigns position numbers to parameters in the order the parameters are declared in the function. To disable this feature, set the value of the `PositionalBinding` argument of -the **CmdletBinding** attribute to `$False`. The `Position` argument takes +the **CmdletBinding** attribute to `$false`. The `Position` argument takes precedence over the value of the `PositionalBinding` argument of the **CmdletBinding** attribute. For more information, see `PositionalBinding` in [about_Functions_CmdletBindingAttribute][12]. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 2039789e526d..c81551e04053 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -175,7 +175,7 @@ lists the changes that the command would make, instead of running the command. The **PositionalBinding** argument determines whether parameters in the function are positional by default. The default value is `$True`. You can use -the **PositionalBinding** argument with a value of `$False` to disable +the **PositionalBinding** argument with a value of `$false` to disable positional binding. The **PositionalBinding** argument is introduced in Windows PowerShell 3.0. @@ -192,7 +192,7 @@ When **PositionalBinding** is `$True`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. -When **PositionalBinding** is `$False`, function parameters are not positional +When **PositionalBinding** is `$false`, function parameters are not positional by default. Unless the **Position** argument of the **Parameter** attribute is declared on the parameter, the parameter name (or an alias or abbreviation) must be included when the parameter is used in a function. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index d1328b2b8b9c..e03df78f7aff 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -119,7 +119,7 @@ any PowerShell modules. If this policy setting isn't configured, the **LogPipelineExecutionDetails** property of each module determines whether PowerShell logs the execution events of that module. By default, the **LogPipelineExecutionDetails** property of all -modules is set to `$False`. +modules is set to `$false`. To turn on module logging for a module, use the following command format. The module must be imported into the session and the setting is effective only in diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 5ea47ece2d4b..1992d072bc57 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -170,7 +170,7 @@ mode: - `$PSCulture` - `$PSUICulture` - `$True` -- `$False` +- `$false` - `$Null` Module manifests are loaded in `RestrictedLanguage` mode and may use these diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md index 40e40e6727f6..bd16790b4abc 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$False` if +that contains `$True` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Pwsh.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Pwsh.md index d476a2025514..fc8a9064496d 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Pwsh.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Pwsh.md @@ -77,7 +77,7 @@ In rare cases, you might need to provide a **Boolean** value for a switch parameter. To provide a **Boolean** value for a switch parameter in the value of the **File** parameter, Use the parameter normally followed immediately by a colon and the boolean value, such as the following: -`-File .\Get-Script.ps1 -All:$False`. +`-File .\Get-Script.ps1 -All:$false`. Parameters passed to the script are passed as literal strings, after interpretation by the current shell. For example, if you are in `cmd.exe` and diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md index baa55973bebf..bf3c6ceab4ed 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -73,7 +73,7 @@ variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. To provide a value for the **WhatIf** switch parameter, use `$True` or -`$False`. +`$false`. ```powershell $HashArguments = @{ diff --git a/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md b/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md index a7c387445de0..405bff693139 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md @@ -548,13 +548,13 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not -have more results, specify a value of `$False`. +have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. When you use the `Receive-Job` cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it -sets the value of the **HasMoreData** property of the job to `$False`) to indicate that it has no +sets the value of the **HasMoreData** property of the job to `$false`) to indicate that it has no more results for the job in the current session. Use the **Keep** parameter of `Receive-Job` to prevent `Receive-Job` from deleting results and changing the value of the **HasMoreData** property. For more information, type `Get-Help Receive-Job`. @@ -562,7 +562,7 @@ For more information, type `Get-Help Receive-Job`. The **HasMoreData** property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the `Receive-Job` cmdlet in a different session to get the job results again, even if -the value of **HasMoreData** is `$False`. For more information, see the help topics for the custom +the value of **HasMoreData** is `$false`. For more information, see the help topics for the custom job type. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index 0f24adc1aefa..d8a9f45fe785 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -585,7 +585,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$False`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 169cd0f56e21..cd9cfe1a51ee 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -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 ba81878f7c87..26557136de08 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/Update-Help.md b/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md index 133586636aeb..e426c0fe4409 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md @@ -193,7 +193,7 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 Param( - [parameter(Mandatory=$False)] + [parameter(Mandatory=$false)] [String[]] $Module ) diff --git a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md index 088dc4c0b26b..ef4851491182 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md @@ -373,7 +373,7 @@ Get-ChildItem | Where-Object { $_.PSIsContainer } ```powershell # Finally, use the -not operator (!) to get objects that are not containers. # This gets objects that do have the **PSIsContainer** property and those -# that have a value of $False for the **PSIsContainer** property. +# that have a value of $false for the **PSIsContainer** property. Get-ChildItem | Where-Object -Not PSIsContainer Get-ChildItem | Where-Object { !$_.PSIsContainer } ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md index 7388e3b2a8f1..1056e342349b 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Split-Path.md @@ -146,7 +146,7 @@ the full path of the parent container. ### Example 4: Determines whether a path is absolute This command determines whether the path is relative or absolute. In this case, because the path is -relative to the current folder, which is represented by a dot (`.`), it returns `$False`. +relative to the current folder, which is represented by a dot (`.`), it returns `$false`. ```powershell Split-Path -Path ".\My Pictures\*.jpg" -IsAbsolute @@ -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/Test-Connection.md b/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md index 3a2af316f67b..95e989ca8f40 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Test-Connection.md @@ -147,7 +147,7 @@ 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 value is `$False`. +the value is `$false`. If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. @@ -406,7 +406,7 @@ specifies multiple computers, an array of **Boolean** values is returned. If **any** ping to a given target succeeds, `$True` is returned. -If **all** pings to a given target fail, `$False` is returned. +If **all** pings to a given target fail, `$false` is returned. ```yaml Type: System.Management.Automation.SwitchParameter @@ -501,7 +501,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 `$False` if a connection is not made. +- The cmdlet returns `$false` if a connection is not made. ```yaml Type: System.Int32 diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md index f5f5758f7783..15df9648e1b6 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md @@ -209,7 +209,7 @@ two properties, **Status** in descending order and **DisplayName** in ascending **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed -before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$False` to sort +before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. ### Example 6: Sort text files by time span diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md index 18ca07b2c592..bc187937810a 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -503,11 +503,11 @@ Indicates whether the set of properties that are serialized is inherited. The de `$Null`. The acceptable values for this parameter are: - `$True`. The property set is inherited. -- `$False`. The property set is not inherited. +- `$false`. The property set is not inherited. - `$Null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is -`SpecificProperties`. When the value of this parameter is `$False`, the **PropertySerializationSet** +`SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** parameter is required. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md index 4e7bddd72d3e..3a13c94b6e7f 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md @@ -62,7 +62,7 @@ $objectEventArgs = @{ } Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 -$Timer.Autoreset = $False +$Timer.Autoreset = $false $Timer.Enabled = $True Wait-Event Timer.Elapsed ``` diff --git a/reference/7.4/PSReadLine/Set-PSReadLineOption.md b/reference/7.4/PSReadLine/Set-PSReadLineOption.md index 9e03e5645823..8fff7bc675e8 100644 --- a/reference/7.4/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.4/PSReadLine/Set-PSReadLineOption.md @@ -504,12 +504,12 @@ to see the command multiple times when recalling or searching the history. By default, the **HistoryNoDuplicates** property of the global **PSConsoleReadLineOptions** object is set to `True`. To change the property value, you must specify the value of the -**SwitchParameter** as follows: `-HistoryNoDuplicates:$False`. You can set back to `True` by using +**SwitchParameter** as follows: `-HistoryNoDuplicates:$false`. You can set back to `True` by using just the **SwitchParameter**, `-HistoryNoDuplicates`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistoryNoDuplicates = $False` +`(Get-PSReadLineOption).HistoryNoDuplicates = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -587,11 +587,11 @@ Specifies that history searching is case-sensitive in functions like **ReverseSe By default, the **HistorySearchCaseSensitive** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** sets the property value to `True`. To change the property value back, you must specify the value of the **SwitchParameter** as follows: -`-HistorySearchCaseSensitive:$False`. +`-HistorySearchCaseSensitive:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCaseSensitive = $False` +`(Get-PSReadLineOption).HistorySearchCaseSensitive = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -608,17 +608,17 @@ Accept wildcard characters: False ### -HistorySearchCursorMovesToEnd Indicates that the cursor moves to the end of commands that you load from history by using a search. -When this parameter is set to `$False`, the cursor remains at the position it was when you pressed +When this parameter is set to `$false`, the cursor remains at the position it was when you pressed the up or down arrows. By default, the **HistorySearchCursorMovesToEnd** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** set the property value to `True`. To change the property value back, you must specify the value of the -**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$False`. +**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $False` +`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -743,17 +743,17 @@ Accept wildcard characters: False When displaying possible completions, tooltips are shown in the list of completions. This option is enabled by default. This option wasn't enabled by default in prior versions of -**PSReadLine**. To disable, set this option to `$False`. +**PSReadLine**. To disable, set this option to `$false`. This parameter and option were added in PSReadLine 2.3.4. By default, the **ShowToolTips** property of the global **PSConsoleReadLineOptions** object is set to `True`. Using this **SwitchParameter** sets the property value to `True`. To change the property -value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$False`. +value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).ShowToolTips = $False` +`(Get-PSReadLineOption).ShowToolTips = $false` ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md index bc1cac37644a..12253e03762d 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -47,7 +47,7 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements - The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$False`, and `$Null` + `$false`, and `$Null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index 64e10d4cc49f..9bf3ed25a583 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -587,7 +587,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ Returns `$True` when the `LastWriteTime` value of a file is greater than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet returns, or a string that can be converted to a **DateTime** object, such as @@ -600,7 +600,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ Returns `$True` when the `LastWriteTime` value of a file is less than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet returns, or a string that can be converted to a [DateTime][01] object, such as diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 66989f74ec48..1b6e02e7b102 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -408,7 +408,7 @@ parameter is used in a command. By default, all function parameters are positional. PowerShell assigns position numbers to parameters in the order the parameters are declared in the function. To disable this feature, set the value of the `PositionalBinding` argument of -the **CmdletBinding** attribute to `$False`. The `Position` argument takes +the **CmdletBinding** attribute to `$false`. The `Position` argument takes precedence over the value of the `PositionalBinding` argument of the **CmdletBinding** attribute. For more information, see `PositionalBinding` in [about_Functions_CmdletBindingAttribute][12]. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 3ff4ea38a32a..efa69e1e1141 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -176,7 +176,7 @@ lists the changes that the command would make, instead of running the command. The **PositionalBinding** argument determines whether parameters in the function are positional by default. The default value is `$True`. You can use -the **PositionalBinding** argument with a value of `$False` to disable +the **PositionalBinding** argument with a value of `$false` to disable positional binding. The **PositionalBinding** argument is introduced in Windows PowerShell 3.0. @@ -193,7 +193,7 @@ When **PositionalBinding** is `$True`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. -When **PositionalBinding** is `$False`, function parameters are not positional +When **PositionalBinding** is `$false`, function parameters are not positional by default. Unless the **Position** argument of the **Parameter** attribute is declared on the parameter, the parameter name (or an alias or abbreviation) must be included when the parameter is used in a function. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index 2a98da8c8e13..a88befa7fcd4 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -119,7 +119,7 @@ any PowerShell modules. If this policy setting isn't configured, the **LogPipelineExecutionDetails** property of each module determines whether PowerShell logs the execution events of that module. By default, the **LogPipelineExecutionDetails** property of all -modules is set to `$False`. +modules is set to `$false`. To turn on module logging for a module, use the following command format. The module must be imported into the session and the setting is effective only in diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 4c70df3446f5..97d89a2d53e1 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -170,7 +170,7 @@ mode: - `$PSCulture` - `$PSUICulture` - `$True` -- `$False` +- `$false` - `$Null` Module manifests are loaded in `RestrictedLanguage` mode and may use these diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md index 28692aa044ac..7b4a7cab38c4 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$False` if +that contains `$True` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Pwsh.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Pwsh.md index 1744b11aab5f..2ed7c8c9ecd4 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Pwsh.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Pwsh.md @@ -77,7 +77,7 @@ In rare cases, you might need to provide a **Boolean** value for a switch parameter. To provide a **Boolean** value for a switch parameter in the value of the **File** parameter, Use the parameter normally followed immediately by a colon and the boolean value, such as the following: -`-File .\Get-Script.ps1 -All:$False`. +`-File .\Get-Script.ps1 -All:$false`. Parameters passed to the script are passed as literal strings, after interpretation by the current shell. For example, if you are in `cmd.exe` and diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md index 427eb35781e1..dff6794765ff 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -73,7 +73,7 @@ variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. To provide a value for the **WhatIf** switch parameter, use `$True` or -`$False`. +`$false`. ```powershell $HashArguments = @{ diff --git a/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md b/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md index 95611ed499e4..db59e6501c83 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md @@ -548,13 +548,13 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not -have more results, specify a value of `$False`. +have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. When you use the `Receive-Job` cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it -sets the value of the **HasMoreData** property of the job to `$False`) to indicate that it has no +sets the value of the **HasMoreData** property of the job to `$false`) to indicate that it has no more results for the job in the current session. Use the **Keep** parameter of `Receive-Job` to prevent `Receive-Job` from deleting results and changing the value of the **HasMoreData** property. For more information, type `Get-Help Receive-Job`. @@ -562,7 +562,7 @@ For more information, type `Get-Help Receive-Job`. The **HasMoreData** property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the `Receive-Job` cmdlet in a different session to get the job results again, even if -the value of **HasMoreData** is `$False`. For more information, see the help topics for the custom +the value of **HasMoreData** is `$false`. For more information, see the help topics for the custom job type. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index fb556a62ffb3..49e097f22546 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -589,7 +589,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$False`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 468a2588d6d5..b96a673be129 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -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 9da5f5c4b3d3..3cb3a8a5ef0f 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/Update-Help.md b/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md index 63994b5ee4e4..866e6810d96c 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md @@ -193,7 +193,7 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 Param( - [parameter(Mandatory=$False)] + [parameter(Mandatory=$false)] [String[]] $Module ) diff --git a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md index 8c96de47a9b8..3da6409ab496 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md @@ -373,7 +373,7 @@ Get-ChildItem | Where-Object { $_.PSIsContainer } ```powershell # Finally, use the -not operator (!) to get objects that are not containers. # This gets objects that do have the **PSIsContainer** property and those -# that have a value of $False for the **PSIsContainer** property. +# that have a value of $false for the **PSIsContainer** property. Get-ChildItem | Where-Object -Not PSIsContainer Get-ChildItem | Where-Object { !$_.PSIsContainer } ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md index 52aacfe25f73..d7818fdd940c 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md @@ -146,7 +146,7 @@ the full path of the parent container. ### Example 4: Determines whether a path is absolute This command determines whether the path is relative or absolute. In this case, because the path is -relative to the current folder, which is represented by a dot (`.`), it returns `$False`. +relative to the current folder, which is represented by a dot (`.`), it returns `$false`. ```powershell Split-Path -Path ".\My Pictures\*.jpg" -IsAbsolute @@ -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/Test-Connection.md b/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md index 0d8dc33c80de..e6f66e86f24c 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Test-Connection.md @@ -147,7 +147,7 @@ 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 value is `$False`. +the value is `$false`. If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. @@ -406,7 +406,7 @@ specifies multiple computers, an array of **Boolean** values is returned. If **any** ping to a given target succeeds, `$True` is returned. -If **all** pings to a given target fail, `$False` is returned. +If **all** pings to a given target fail, `$false` is returned. ```yaml Type: System.Management.Automation.SwitchParameter @@ -501,7 +501,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 `$False` if a connection is not made. +- The cmdlet returns `$false` if a connection is not made. ```yaml Type: System.Int32 diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md index a24c4ff49532..6f13d7c46b23 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md @@ -209,7 +209,7 @@ two properties, **Status** in descending order and **DisplayName** in ascending **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed -before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$False` to sort +before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. ### Example 6: Sort text files by time span diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md index 0e36e8f8ba23..289121810f4d 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -503,11 +503,11 @@ Indicates whether the set of properties that are serialized is inherited. The de `$Null`. The acceptable values for this parameter are: - `$True`. The property set is inherited. -- `$False`. The property set is not inherited. +- `$false`. The property set is not inherited. - `$Null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is -`SpecificProperties`. When the value of this parameter is `$False`, the **PropertySerializationSet** +`SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** parameter is required. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md index 90a7dd967929..2ef50d33707a 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md @@ -62,7 +62,7 @@ $objectEventArgs = @{ } Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 -$Timer.AutoReset = $False +$Timer.AutoReset = $false $Timer.Enabled = $True Wait-Event Timer.Elapsed ``` diff --git a/reference/7.5/PSReadLine/Set-PSReadLineOption.md b/reference/7.5/PSReadLine/Set-PSReadLineOption.md index c63130ea2ad6..677319c659bc 100644 --- a/reference/7.5/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.5/PSReadLine/Set-PSReadLineOption.md @@ -504,12 +504,12 @@ to see the command multiple times when recalling or searching the history. By default, the **HistoryNoDuplicates** property of the global **PSConsoleReadLineOptions** object is set to `True`. To change the property value, you must specify the value of the -**SwitchParameter** as follows: `-HistoryNoDuplicates:$False`. You can set back to `True` by using +**SwitchParameter** as follows: `-HistoryNoDuplicates:$false`. You can set back to `True` by using just the **SwitchParameter**, `-HistoryNoDuplicates`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistoryNoDuplicates = $False` +`(Get-PSReadLineOption).HistoryNoDuplicates = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -587,11 +587,11 @@ Specifies that history searching is case-sensitive in functions like **ReverseSe By default, the **HistorySearchCaseSensitive** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** sets the property value to `True`. To change the property value back, you must specify the value of the **SwitchParameter** as follows: -`-HistorySearchCaseSensitive:$False`. +`-HistorySearchCaseSensitive:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCaseSensitive = $False` +`(Get-PSReadLineOption).HistorySearchCaseSensitive = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -608,17 +608,17 @@ Accept wildcard characters: False ### -HistorySearchCursorMovesToEnd Indicates that the cursor moves to the end of commands that you load from history by using a search. -When this parameter is set to `$False`, the cursor remains at the position it was when you pressed +When this parameter is set to `$false`, the cursor remains at the position it was when you pressed the up or down arrows. By default, the **HistorySearchCursorMovesToEnd** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** set the property value to `True`. To change the property value back, you must specify the value of the -**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$False`. +**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $False` +`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -743,17 +743,17 @@ Accept wildcard characters: False When displaying possible completions, tooltips are shown in the list of completions. This option is enabled by default. This option wasn't enabled by default in prior versions of -**PSReadLine**. To disable, set this option to `$False`. +**PSReadLine**. To disable, set this option to `$false`. This parameter and option were added in PSReadLine 2.3.4. By default, the **ShowToolTips** property of the global **PSConsoleReadLineOptions** object is set to `True`. Using this **SwitchParameter** sets the property value to `True`. To change the property -value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$False`. +value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).ShowToolTips = $False` +`(Get-PSReadLineOption).ShowToolTips = $false` ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 8c91d7025dd4..3da590442c3b 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -47,7 +47,7 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements - The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$False`, and `$Null` + `$false`, and `$Null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index ef1808b95671..0119087a91c9 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -587,7 +587,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ Returns `$True` when the `LastWriteTime` value of a file is greater than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet returns, or a string that can be converted to a **DateTime** object, such as @@ -600,7 +600,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ Returns `$True` when the `LastWriteTime` value of a file is less than the -specified date. Otherwise, it returns `$False`. +specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet returns, or a string that can be converted to a [DateTime][01] object, such as diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 456f8e8c50d9..9857f8713026 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -408,7 +408,7 @@ parameter is used in a command. By default, all function parameters are positional. PowerShell assigns position numbers to parameters in the order the parameters are declared in the function. To disable this feature, set the value of the `PositionalBinding` argument of -the **CmdletBinding** attribute to `$False`. The `Position` argument takes +the **CmdletBinding** attribute to `$false`. The `Position` argument takes precedence over the value of the `PositionalBinding` argument of the **CmdletBinding** attribute. For more information, see `PositionalBinding` in [about_Functions_CmdletBindingAttribute][12]. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index bf6b156397c2..4a74759e6c1b 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -176,7 +176,7 @@ lists the changes that the command would make, instead of running the command. The **PositionalBinding** argument determines whether parameters in the function are positional by default. The default value is `$True`. You can use -the **PositionalBinding** argument with a value of `$False` to disable +the **PositionalBinding** argument with a value of `$false` to disable positional binding. The **PositionalBinding** argument is introduced in Windows PowerShell 3.0. @@ -193,7 +193,7 @@ When **PositionalBinding** is `$True`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. -When **PositionalBinding** is `$False`, function parameters are not positional +When **PositionalBinding** is `$false`, function parameters are not positional by default. Unless the **Position** argument of the **Parameter** attribute is declared on the parameter, the parameter name (or an alias or abbreviation) must be included when the parameter is used in a function. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index d36d9df68ca7..94361ba1d877 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -119,7 +119,7 @@ any PowerShell modules. If this policy setting isn't configured, the **LogPipelineExecutionDetails** property of each module determines whether PowerShell logs the execution events of that module. By default, the **LogPipelineExecutionDetails** property of all -modules is set to `$False`. +modules is set to `$false`. To turn on module logging for a module, use the following command format. The module must be imported into the session and the setting is effective only in diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 846cf65c393f..401482088bcc 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -170,7 +170,7 @@ mode: - `$PSCulture` - `$PSUICulture` - `$True` -- `$False` +- `$false` - `$Null` Module manifests are loaded in `RestrictedLanguage` mode and may use these diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md index 226a5c2ba391..a2c571f916bb 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$False` if +that contains `$True` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Pwsh.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Pwsh.md index bda4a1358657..2d2aa722cffc 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Pwsh.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Pwsh.md @@ -77,7 +77,7 @@ In rare cases, you might need to provide a **Boolean** value for a switch parameter. To provide a **Boolean** value for a switch parameter in the value of the **File** parameter, Use the parameter normally followed immediately by a colon and the boolean value, such as the following: -`-File .\Get-Script.ps1 -All:$False`. +`-File .\Get-Script.ps1 -All:$false`. Parameters passed to the script are passed as literal strings, after interpretation by the current shell. For example, if you are in `cmd.exe` and diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md index d7d0f3b3d1c7..b41251bc70f3 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -73,7 +73,7 @@ variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. To provide a value for the **WhatIf** switch parameter, use `$True` or -`$False`. +`$false`. ```powershell $HashArguments = @{ diff --git a/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md b/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md index 3e78d186a693..e71c38131853 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md @@ -547,13 +547,13 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not -have more results, specify a value of `$False`. +have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. When you use the `Receive-Job` cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it -sets the value of the **HasMoreData** property of the job to `$False`) to indicate that it has no +sets the value of the **HasMoreData** property of the job to `$false`) to indicate that it has no more results for the job in the current session. Use the **Keep** parameter of `Receive-Job` to prevent `Receive-Job` from deleting results and changing the value of the **HasMoreData** property. For more information, type `Get-Help Receive-Job`. @@ -561,7 +561,7 @@ For more information, type `Get-Help Receive-Job`. The **HasMoreData** property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the `Receive-Job` cmdlet in a different session to get the job results again, even if -the value of **HasMoreData** is `$False`. For more information, see the help topics for the custom +the value of **HasMoreData** is `$false`. For more information, see the help topics for the custom job type. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index 608bbc45dfea..908a32d582a0 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -585,7 +585,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$False`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 213dea2ae0c6..6e060c5d2a28 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -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 29373bb9d7ba..e9eeae081172 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/Update-Help.md b/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md index f4029609b049..764b2ee31272 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md @@ -193,7 +193,7 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 Param( - [parameter(Mandatory=$False)] + [parameter(Mandatory=$false)] [String[]] $Module ) diff --git a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md index fe5728371439..92b5679fc08e 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md @@ -373,7 +373,7 @@ Get-ChildItem | Where-Object { $_.PSIsContainer } ```powershell # Finally, use the -not operator (!) to get objects that are not containers. # This gets objects that do have the **PSIsContainer** property and those -# that have a value of $False for the **PSIsContainer** property. +# that have a value of $false for the **PSIsContainer** property. Get-ChildItem | Where-Object -Not PSIsContainer Get-ChildItem | Where-Object { !$_.PSIsContainer } ``` diff --git a/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md index c8e17c9773b1..21c8eb1767b1 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Split-Path.md @@ -146,7 +146,7 @@ the full path of the parent container. ### Example 4: Determines whether a path is absolute This command determines whether the path is relative or absolute. In this case, because the path is -relative to the current folder, which is represented by a dot (`.`), it returns `$False`. +relative to the current folder, which is represented by a dot (`.`), it returns `$false`. ```powershell Split-Path -Path ".\My Pictures\*.jpg" -IsAbsolute @@ -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/Test-Connection.md b/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md index 23e222548a88..01a12141b46d 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Test-Connection.md @@ -147,7 +147,7 @@ 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 value is `$False`. +the value is `$false`. If the `Test-Connection` command returns a value of `$True`, the command uses the `New-PSSession` cmdlet to create the **PSSession**. @@ -406,7 +406,7 @@ specifies multiple computers, an array of **Boolean** values is returned. If **any** ping to a given target succeeds, `$True` is returned. -If **all** pings to a given target fail, `$False` is returned. +If **all** pings to a given target fail, `$false` is returned. ```yaml Type: System.Management.Automation.SwitchParameter @@ -501,7 +501,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 `$False` if a connection is not made. +- The cmdlet returns `$false` if a connection is not made. ```yaml Type: System.Int32 diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md index 6bc6725cbf32..e81be4d554f8 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md @@ -209,7 +209,7 @@ two properties, **Status** in descending order and **DisplayName** in ascending **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed -before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$False` to sort +before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. ### Example 6: Sort text files by time span diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md index 38213f6b8eea..a72c4a34f20c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -503,11 +503,11 @@ Indicates whether the set of properties that are serialized is inherited. The de `$Null`. The acceptable values for this parameter are: - `$True`. The property set is inherited. -- `$False`. The property set is not inherited. +- `$false`. The property set is not inherited. - `$Null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is -`SpecificProperties`. When the value of this parameter is `$False`, the **PropertySerializationSet** +`SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** parameter is required. This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md index 9fa3ca71170e..ffb3dce86fa2 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md @@ -62,7 +62,7 @@ $objectEventArgs = @{ } Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 -$Timer.AutoReset = $False +$Timer.AutoReset = $false $Timer.Enabled = $True Wait-Event Timer.Elapsed ``` diff --git a/reference/7.6/PSReadLine/Set-PSReadLineOption.md b/reference/7.6/PSReadLine/Set-PSReadLineOption.md index 32e82a12f1e8..b14d2b424a57 100644 --- a/reference/7.6/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.6/PSReadLine/Set-PSReadLineOption.md @@ -504,12 +504,12 @@ to see the command multiple times when recalling or searching the history. By default, the **HistoryNoDuplicates** property of the global **PSConsoleReadLineOptions** object is set to `True`. To change the property value, you must specify the value of the -**SwitchParameter** as follows: `-HistoryNoDuplicates:$False`. You can set back to `True` by using +**SwitchParameter** as follows: `-HistoryNoDuplicates:$false`. You can set back to `True` by using just the **SwitchParameter**, `-HistoryNoDuplicates`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistoryNoDuplicates = $False` +`(Get-PSReadLineOption).HistoryNoDuplicates = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -587,11 +587,11 @@ Specifies that history searching is case-sensitive in functions like **ReverseSe By default, the **HistorySearchCaseSensitive** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** sets the property value to `True`. To change the property value back, you must specify the value of the **SwitchParameter** as follows: -`-HistorySearchCaseSensitive:$False`. +`-HistorySearchCaseSensitive:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCaseSensitive = $False` +`(Get-PSReadLineOption).HistorySearchCaseSensitive = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -608,17 +608,17 @@ Accept wildcard characters: False ### -HistorySearchCursorMovesToEnd Indicates that the cursor moves to the end of commands that you load from history by using a search. -When this parameter is set to `$False`, the cursor remains at the position it was when you pressed +When this parameter is set to `$false`, the cursor remains at the position it was when you pressed the up or down arrows. By default, the **HistorySearchCursorMovesToEnd** property of the global **PSConsoleReadLineOptions** object is set to `False`. Using this **SwitchParameter** set the property value to `True`. To change the property value back, you must specify the value of the -**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$False`. +**SwitchParameter** as follows: `-HistorySearchCursorMovesToEnd:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $False` +`(Get-PSReadLineOption).HistorySearchCursorMovesToEnd = $false` ```yaml Type: System.Management.Automation.SwitchParameter @@ -743,17 +743,17 @@ Accept wildcard characters: False When displaying possible completions, tooltips are shown in the list of completions. This option is enabled by default. This option wasn't enabled by default in prior versions of -**PSReadLine**. To disable, set this option to `$False`. +**PSReadLine**. To disable, set this option to `$false`. This parameter and option were added in PSReadLine 2.3.4. By default, the **ShowToolTips** property of the global **PSConsoleReadLineOptions** object is set to `True`. Using this **SwitchParameter** sets the property value to `True`. To change the property -value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$False`. +value, you must specify the value of the **SwitchParameter** as follows: `-ShowToolTips:$false`. Using the following command, you can set the property value directly: -`(Get-PSReadLineOption).ShowToolTips = $False` +`(Get-PSReadLineOption).ShowToolTips = $false` ```yaml Type: System.Management.Automation.SwitchParameter From 337eb29ae6130a11a87d369e5df767b7d631fc1f Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:14:34 +0000 Subject: [PATCH 08/16] Fix automatic variable case (#11830) --- .../About/about_Automatic_Variables.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Data_Sections.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/About/about_Functions.md | 2 +- .../About/about_Functions_Advanced_Methods.md | 2 +- .../About/about_Functions_Advanced_Parameters.md | 2 +- .../About/about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Language_Modes.md | 4 ++-- .../About/about_Automatic_Variables.md | 4 ++-- .../Microsoft.PowerShell.Core/About/about_Data_Sections.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/About/about_Functions.md | 2 +- .../About/about_Functions_Advanced_Methods.md | 2 +- .../About/about_Functions_Advanced_Parameters.md | 2 +- .../About/about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Language_Modes.md | 4 ++-- .../About/about_Automatic_Variables.md | 4 ++-- .../Microsoft.PowerShell.Core/About/about_Data_Sections.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/About/about_Functions.md | 2 +- .../About/about_Functions_Advanced_Methods.md | 2 +- .../About/about_Functions_Advanced_Parameters.md | 2 +- .../About/about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Language_Modes.md | 4 ++-- .../About/about_Automatic_Variables.md | 4 ++-- .../Microsoft.PowerShell.Core/About/about_Data_Sections.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md | 2 +- .../About/about_FileSystem_Provider.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/About/about_Functions.md | 2 +- .../About/about_Functions_Advanced_Methods.md | 2 +- .../About/about_Functions_Advanced_Parameters.md | 2 +- .../About/about_Functions_CmdletBindingAttribute.md | 4 ++-- .../About/about_Group_Policy_Settings.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Language_Modes.md | 4 ++-- 40 files changed, 59 insertions(+), 59 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 0773e9879cb4..0ecc090fcd66 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -205,7 +205,7 @@ non-zero integer. ### `$foreach` Contains the enumerator (not the resulting values) of a [ForEach][56] loop. The -`$ForEach` variable exists only while the `ForEach` loop is running; it's +`$foreach` variable exists only while the `ForEach` loop is running; it's deleted after the loop is completed. Enumerators contain properties and methods you can use to retrieve loop values diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 599ac334c78e..06006bf0e140 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -46,8 +46,8 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements -- The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$false`, and `$Null` +- The following automatic variables: `$PSCulture`, `$PSUICulture`, `$true`, + `$false`, and `$null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md index 45cf224e70b9..1b637fa96b80 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -127,7 +127,7 @@ for the following automatic variables: ```powershell $_ $args -$Input +$input $MyInvocation $PSBoundParameters ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index 73fdadff63c2..08bd4b0055f4 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -581,7 +581,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ -Returns `$True` when the `LastWriteTime` value of a file is greater than the +Returns `$true` when the `LastWriteTime` value of a file is greater than the specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet @@ -594,7 +594,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ -Returns `$True` when the `LastWriteTime` value of a file is less than the +Returns `$true` when the `LastWriteTime` value of a file is less than the specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md index 60a22f5a2afa..e3588f760a62 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md @@ -119,7 +119,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] Param ($Parameter1) begin{} process{} diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md index 550020405cb7..8d1e50402dd6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md @@ -53,7 +53,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] param ($Parameter1) begin{} process{} diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index e158f0b572e0..f8e9e3ef8200 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1203,7 +1203,7 @@ function Test-UserDrivePath{ [ValidateUserDrive()] [string]$Path ) - $True + $true } Test-UserDrivePath -Path C:\ diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index a07dd10a2c5f..0af3fe80a26b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -174,7 +174,7 @@ lists the changes that the command would make, instead of running the command. ## PositionalBinding The **PositionalBinding** argument determines whether parameters in the -function are positional by default. The default value is `$True`. You can use +function are positional by default. The default value is `$true`. You can use the **PositionalBinding** argument with a value of `$false` to disable positional binding. @@ -188,7 +188,7 @@ function command. When parameters are not positional (they are "named"), the parameter name (or an abbreviation or alias of the name) is required in the command. -When **PositionalBinding** is `$True`, function parameters are positional by +When **PositionalBinding** is `$true`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index 56cd9644a628..e13cc1fe1f8d 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -80,7 +80,7 @@ Import-Module To turn on module logging for all sessions on a particular computer, add the previous commands to the 'All Users' PowerShell profile -(`$Profile.AllUsersAllHosts`). +(`$PROFILE.AllUsersAllHosts`). For more information about module logging, see [about_Modules](about_Modules.md). diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 463f8966245a..085755c94d4d 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -166,9 +166,9 @@ mode: - `$PSCulture` - `$PSUICulture` -- `$True` +- `$true` - `$false` -- `$Null` +- `$null` Module manifests are loaded in `RestrictedLanguage` mode and may use these additional variables: diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index e181edfe1083..6009937e40df 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -212,7 +212,7 @@ non-zero integer. ### `$foreach` Contains the enumerator (not the resulting values) of a [ForEach][56] loop. The -`$ForEach` variable exists only while the `ForEach` loop is running; it's +`$foreach` variable exists only while the `ForEach` loop is running; it's deleted after the loop is completed. Enumerators contain properties and methods you can use to retrieve loop values @@ -644,7 +644,7 @@ following items: - **GitCommitId** - The commit Id of the source files, in GitHub, - **OS** - Description of the operating system that PowerShell is running on. - **Platform** - Platform that the operating system is running on. The value on - Linux and macOS is **Unix**. See `$IsMacOs` and `$IsLinux`. + Linux and macOS is **Unix**. See `$IsMacOS` and `$IsLinux`. - **PSCompatibleVersions** - Versions of PowerShell that are compatible with the current version - **PSRemotingProtocolVersion** - The version of the PowerShell remote diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 31d497f941d6..5e4bd3046bef 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -46,8 +46,8 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements -- The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$false`, and `$Null` +- The following automatic variables: `$PSCulture`, `$PSUICulture`, `$true`, + `$false`, and `$null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md index b151cefb104b..6b1c19985229 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -127,7 +127,7 @@ for the following automatic variables: ```powershell $_ $args -$Input +$input $MyInvocation $PSBoundParameters ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index e24d00fc326a..4f3dda5f1423 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -586,7 +586,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ -Returns `$True` when the `LastWriteTime` value of a file is greater than the +Returns `$true` when the `LastWriteTime` value of a file is greater than the specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet @@ -599,7 +599,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ -Returns `$True` when the `LastWriteTime` value of a file is less than the +Returns `$true` when the `LastWriteTime` value of a file is less than the specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md index ee7fa3b771d3..22c991012e62 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md @@ -122,7 +122,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] Param ($Parameter1) begin{} process{} diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md index 059ffdf02e45..57fed7c7ae30 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md @@ -54,7 +54,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] param ($Parameter1) begin{} process{} diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index f4b3eee75709..fa57cd7758e8 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1292,7 +1292,7 @@ function Test-UserDrivePath{ [ValidateUserDrive()] [string]$Path ) - $True + $true } Test-UserDrivePath -Path C:\ diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index c81551e04053..20eeeaf8fd50 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -174,7 +174,7 @@ lists the changes that the command would make, instead of running the command. ## PositionalBinding The **PositionalBinding** argument determines whether parameters in the -function are positional by default. The default value is `$True`. You can use +function are positional by default. The default value is `$true`. You can use the **PositionalBinding** argument with a value of `$false` to disable positional binding. @@ -188,7 +188,7 @@ function command. When parameters are not positional (they are "named"), the parameter name (or an abbreviation or alias of the name) is required in the command. -When **PositionalBinding** is `$True`, function parameters are positional by +When **PositionalBinding** is `$true`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index e03df78f7aff..5d1b3e98ed20 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -132,7 +132,7 @@ Import-Module To turn on module logging for all sessions on a particular computer, add the previous commands to the 'All Users' PowerShell profile -(`$Profile.AllUsersAllHosts`). +(`$PROFILE.AllUsersAllHosts`). For more information about module logging, see [about_Modules](about_Modules.md). diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 1992d072bc57..d3ec79ad18ea 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -169,9 +169,9 @@ mode: - `$PSCulture` - `$PSUICulture` -- `$True` +- `$true` - `$false` -- `$Null` +- `$null` Module manifests are loaded in `RestrictedLanguage` mode and may use these additional variables: diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 5b8d63b04f65..9641e0acb0dd 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -212,7 +212,7 @@ non-zero integer. ### `$foreach` Contains the enumerator (not the resulting values) of a [ForEach][56] loop. The -`$ForEach` variable exists only while the `ForEach` loop is running; it's +`$foreach` variable exists only while the `ForEach` loop is running; it's deleted after the loop is completed. Enumerators contain properties and methods you can use to retrieve loop values @@ -644,7 +644,7 @@ following items: - **GitCommitId** - The commit Id of the source files, in GitHub, - **OS** - Description of the operating system that PowerShell is running on. - **Platform** - Platform that the operating system is running on. The value on - Linux and macOS is **Unix**. See `$IsMacOs` and `$IsLinux`. + Linux and macOS is **Unix**. See `$IsMacOS` and `$IsLinux`. - **PSCompatibleVersions** - Versions of PowerShell that are compatible with the current version - **PSRemotingProtocolVersion** - The version of the PowerShell remote diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 12253e03762d..1886590e8933 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -46,8 +46,8 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements -- The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$false`, and `$Null` +- The following automatic variables: `$PSCulture`, `$PSUICulture`, `$true`, + `$false`, and `$null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md index b1664577ecab..df77679a12d1 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -127,7 +127,7 @@ for the following automatic variables: ```powershell $_ $args -$Input +$input $MyInvocation $PSBoundParameters ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index 9bf3ed25a583..d2ec1405af73 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -586,7 +586,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ -Returns `$True` when the `LastWriteTime` value of a file is greater than the +Returns `$true` when the `LastWriteTime` value of a file is greater than the specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet @@ -599,7 +599,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ -Returns `$True` when the `LastWriteTime` value of a file is less than the +Returns `$true` when the `LastWriteTime` value of a file is less than the specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md index 4a54c8e9ecbf..e7da581dca1e 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md @@ -122,7 +122,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] Param ($Parameter1) begin{} process{} diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md index 50e9f5a0861d..2da0eb98e4ec 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md @@ -54,7 +54,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] param ($Parameter1) begin{} process{} diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 1b6e02e7b102..cd03414c1c02 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1292,7 +1292,7 @@ function Test-UserDrivePath{ [ValidateUserDrive()] [string]$Path ) - $True + $true } Test-UserDrivePath -Path C:\ diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index efa69e1e1141..349d256a3088 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -175,7 +175,7 @@ lists the changes that the command would make, instead of running the command. ## PositionalBinding The **PositionalBinding** argument determines whether parameters in the -function are positional by default. The default value is `$True`. You can use +function are positional by default. The default value is `$true`. You can use the **PositionalBinding** argument with a value of `$false` to disable positional binding. @@ -189,7 +189,7 @@ function command. When parameters are not positional (they are "named"), the parameter name (or an abbreviation or alias of the name) is required in the command. -When **PositionalBinding** is `$True`, function parameters are positional by +When **PositionalBinding** is `$true`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index a88befa7fcd4..ccec829540a6 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -132,7 +132,7 @@ Import-Module To turn on module logging for all sessions on a particular computer, add the previous commands to the 'All Users' PowerShell profile -(`$Profile.AllUsersAllHosts`). +(`$PROFILE.AllUsersAllHosts`). For more information about module logging, see [about_Modules](about_Modules.md). diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 97d89a2d53e1..5eefd778012b 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -169,9 +169,9 @@ mode: - `$PSCulture` - `$PSUICulture` -- `$True` +- `$true` - `$false` -- `$Null` +- `$null` Module manifests are loaded in `RestrictedLanguage` mode and may use these additional variables: diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 17ad32f40902..77579dd8b7ec 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -212,7 +212,7 @@ non-zero integer. ### `$foreach` Contains the enumerator (not the resulting values) of a [ForEach][56] loop. The -`$ForEach` variable exists only while the `ForEach` loop is running; it's +`$foreach` variable exists only while the `ForEach` loop is running; it's deleted after the loop is completed. Enumerators contain properties and methods you can use to retrieve loop values @@ -644,7 +644,7 @@ following items: - **GitCommitId** - The commit Id of the source files, in GitHub, - **OS** - Description of the operating system that PowerShell is running on. - **Platform** - Platform that the operating system is running on. The value on - Linux and macOS is **Unix**. See `$IsMacOs` and `$IsLinux`. + Linux and macOS is **Unix**. See `$IsMacOS` and `$IsLinux`. - **PSCompatibleVersions** - Versions of PowerShell that are compatible with the current version - **PSRemotingProtocolVersion** - The version of the PowerShell remote diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 3da590442c3b..43a3a7da8a92 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -46,8 +46,8 @@ is limited to the following elements: - All PowerShell operators, except `-match` - `If`, `Else`, and `ElseIf` statements -- The following automatic variables: `$PsCulture`, `$PsUICulture`, `$True`, - `$false`, and `$Null` +- The following automatic variables: `$PSCulture`, `$PSUICulture`, `$true`, + `$false`, and `$null` - Comments - Pipelines - Statements separated by semicolons (`;`) diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md index 66b2fdf310dd..adcae3c9f6b1 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -127,7 +127,7 @@ for the following automatic variables: ```powershell $_ $args -$Input +$input $MyInvocation $PSBoundParameters ``` diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index 0119087a91c9..2279c6cae3ea 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -586,7 +586,7 @@ system files and folders, use the **Attributes** parameter. ### NewerThan \ -Returns `$True` when the `LastWriteTime` value of a file is greater than the +Returns `$true` when the `LastWriteTime` value of a file is greater than the specified date. Otherwise, it returns `$false`. Enter a [DateTime][01] object, such as one that the [Get-Date][37] cmdlet @@ -599,7 +599,7 @@ returns, or a string that can be converted to a **DateTime** object, such as ### OlderThan \ -Returns `$True` when the `LastWriteTime` value of a file is less than the +Returns `$true` when the `LastWriteTime` value of a file is less than the specified date. Otherwise, it returns `$false`. Enter a **DateTime** object, such as one that the `Get-Date` cmdlet diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md index 468d4cef4a98..b9443dd26938 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md @@ -122,7 +122,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] Param ($Parameter1) begin{} process{} diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md index 446a169b63d7..980b3fdaf17e 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md @@ -54,7 +54,7 @@ processing, and an `end` block for one-time post-processing. ```powershell Function Test-ScriptCmdlet { -[CmdletBinding(SupportsShouldProcess=$True)] +[CmdletBinding(SupportsShouldProcess=$true)] param ($Parameter1) begin{} process{} diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 9857f8713026..af9d755c9b75 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -1292,7 +1292,7 @@ function Test-UserDrivePath{ [ValidateUserDrive()] [string]$Path ) - $True + $true } Test-UserDrivePath -Path C:\ diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md index 4a74759e6c1b..49d859114689 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md @@ -175,7 +175,7 @@ lists the changes that the command would make, instead of running the command. ## PositionalBinding The **PositionalBinding** argument determines whether parameters in the -function are positional by default. The default value is `$True`. You can use +function are positional by default. The default value is `$true`. You can use the **PositionalBinding** argument with a value of `$false` to disable positional binding. @@ -189,7 +189,7 @@ function command. When parameters are not positional (they are "named"), the parameter name (or an abbreviation or alias of the name) is required in the command. -When **PositionalBinding** is `$True`, function parameters are positional by +When **PositionalBinding** is `$true`, function parameters are positional by default. PowerShell assigns position number to the parameters in the order in which they are declared in the function. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index 94361ba1d877..2e90aac3fa9b 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -132,7 +132,7 @@ Import-Module To turn on module logging for all sessions on a particular computer, add the previous commands to the 'All Users' PowerShell profile -(`$Profile.AllUsersAllHosts`). +(`$PROFILE.AllUsersAllHosts`). For more information about module logging, see [about_Modules](about_Modules.md). diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md index 401482088bcc..45a63e4ee055 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -169,9 +169,9 @@ mode: - `$PSCulture` - `$PSUICulture` -- `$True` +- `$true` - `$false` -- `$Null` +- `$null` Module manifests are loaded in `RestrictedLanguage` mode and may use these additional variables: From c313de9e2e423047b3f31556409b2e0b309fb883 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:17:02 +0000 Subject: [PATCH 09/16] Fix automatic variable case (#11831) --- .../About/about_Object_Creation.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/About/about_Properties.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md | 6 +++--- .../About/about_Script_Internationalization.md | 2 +- .../5.1/Microsoft.PowerShell.Core/About/about_Scripts.md | 6 +++--- .../About/about_Session_Configuration_Files.md | 2 +- .../5.1/Microsoft.PowerShell.Core/About/about_Splatting.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Type_Operators.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Updatable_Help.md | 2 +- .../About/about_Object_Creation.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/About/about_Properties.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md | 6 +++--- .../About/about_Script_Internationalization.md | 2 +- .../7.4/Microsoft.PowerShell.Core/About/about_Scripts.md | 6 +++--- .../About/about_Session_Configuration_Files.md | 2 +- .../7.4/Microsoft.PowerShell.Core/About/about_Splatting.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Type_Operators.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Updatable_Help.md | 2 +- .../About/about_Object_Creation.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/About/about_Properties.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md | 6 +++--- .../About/about_Script_Internationalization.md | 2 +- .../7.5/Microsoft.PowerShell.Core/About/about_Scripts.md | 6 +++--- .../About/about_Session_Configuration_Files.md | 2 +- .../7.5/Microsoft.PowerShell.Core/About/about_Splatting.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Type_Operators.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Updatable_Help.md | 2 +- .../About/about_Object_Creation.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/About/about_Prompts.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/About/about_Properties.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md | 6 +++--- .../About/about_Script_Internationalization.md | 2 +- .../7.6/Microsoft.PowerShell.Core/About/about_Scripts.md | 6 +++--- .../About/about_Session_Configuration_Files.md | 2 +- .../7.6/Microsoft.PowerShell.Core/About/about_Splatting.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Type_Operators.md | 2 +- .../Microsoft.PowerShell.Core/About/about_Updatable_Help.md | 2 +- 40 files changed, 64 insertions(+), 64 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Object_Creation.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Object_Creation.md index 4a08d9041007..14a6b7ae9fd9 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Object_Creation.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Object_Creation.md @@ -251,7 +251,7 @@ For example, the following command creates a session option object. ```powershell [System.Management.Automation.Remoting.PSSessionOption]@{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } ``` @@ -291,7 +291,7 @@ cmdlet can be a hash table. ```powershell New-PSSession -ComputerName Server01 -SessionOption @{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } Register-ScheduledJob -Name Test -FilePath .\Get-Inventory.ps1 -Trigger @{ Frequency="Daily" diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md index c9968ac1626f..0450d2f14b1a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -73,7 +73,7 @@ For example: ``` ```Output -"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -114,7 +114,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md index 630cc0db09af..aa6b177ca34e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$false` if +that contains `$true` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index 00a7b4cbcb63..dd7959510746 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -312,7 +312,7 @@ reproduced exactly. For example: ```powershell @' -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. '@ ``` @@ -320,7 +320,7 @@ of your PowerShell profile. The output of this command is: ```Output -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. ``` @@ -331,7 +331,7 @@ example: @" Even if you have not created a profile, the path of the profile file is: -$profile. +$PROFILE. "@ ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md index 50b088a7405b..1358fbbb6362 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md @@ -160,7 +160,7 @@ if (!($username)) { $msgTable.promptMsg } ``` If `Import-LocalizedData` cannot find a `.psd1` file that matches the value of -`$PSUIculture`, the value of `$msgTable` is not replaced, and the call to +`$PSUICulture`, the value of `$msgTable` is not replaced, and the call to `$msgTable.promptMsg` displays the fallback en-US strings. ## Examples diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md index f17e85c8367a..04532a6a6db1 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -302,12 +302,12 @@ function and the `$ProfileName` variable. function New-Profile { Write-Host "Running New-Profile function" - $profileName = Split-Path $profile -Leaf + $profileName = Split-Path $PROFILE -Leaf - if (Test-Path $profile) + if (Test-Path $PROFILE) {Write-Error "Profile $profileName already exists on this computer."} else - {New-Item -Type file -Path $profile -Force } + {New-Item -Type file -Path $PROFILE -Force } } ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md index a6a74e07aab2..110350375464 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md @@ -205,7 +205,7 @@ active copy of the session configuration file. When you use a session configuration file in a session configuration, PowerShell creates an active copy of the session configuration file and stores -it in the \$pshome\\SessionConfig directory on the local computer. +it in the \$PSHOME\\SessionConfig directory on the local computer. The location of the active copy of a session configuration file is stored in the ConfigFilePath property of the session configuration object. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md index 6e430e8e262f..0c25314f1d77 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -69,7 +69,7 @@ table of parameter-name and parameter-value pairs and stores it in the variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. -To provide a value for the **WhatIf** switch parameter, use `$True` or +To provide a value for the **WhatIf** switch parameter, use `$true` or `$false`. ```powershell diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 459ae17e4db1..fe6da7c106f0 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -73,7 +73,7 @@ The **Boolean** type operators (`-is` and `-isnot`) always return a **Boolean** value, even if the input is a collection of objects. If `` is a type that is the same as or is _derived_ from the .NET Type, -the `-is` operator returns `$True`. +the `-is` operator returns `$true`. For example, the **DirectoryInfo** type is derived from the **FileSystemInfo** type. Therefore, both of these examples return **True**. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Updatable_Help.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Updatable_Help.md index aeb391b578fa..a2fa92b1e9f3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Updatable_Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Updatable_Help.md @@ -141,7 +141,7 @@ Update-Help -Module Microsoft.PowerShell.Security ## Permissions for updatable help -To update help for the modules in the directory `$pshome/Modules`, you must be +To update help for the modules in the directory `$PSHOME/Modules`, you must be member of the Administrators group on the computer. If you aren't a member of the Administrators group, you can't update help for diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Object_Creation.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Object_Creation.md index 8fba97cbda98..2c9dc918853a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Object_Creation.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Object_Creation.md @@ -247,7 +247,7 @@ For example, the following command creates a session option object. ```powershell [System.Management.Automation.Remoting.PSSessionOption]@{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } ``` @@ -287,7 +287,7 @@ cmdlet can be a hash table. ```powershell New-PSSession -ComputerName Server01 -SessionOption @{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } Register-ScheduledJob -Name Test -FilePath .\Get-Inventory.ps1 -Trigger @{ Frequency="Daily" diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md index 930f9f8b3b5a..880169fe9b93 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -73,7 +73,7 @@ For example: ``` ```Output -"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -114,7 +114,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md index bd16790b4abc..32a491e69f16 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$false` if +that contains `$true` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index a3828c866d93..60cd09726232 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -312,7 +312,7 @@ reproduced exactly. For example: ```powershell @' -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. '@ ``` @@ -320,7 +320,7 @@ of your PowerShell profile. The output of this command is: ```Output -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. ``` @@ -331,7 +331,7 @@ example: @" Even if you have not created a profile, the path of the profile file is: -$profile. +$PROFILE. "@ ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md index 1b8c9cc330a4..24db49d606b8 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md @@ -160,7 +160,7 @@ if (!($username)) { $msgTable.promptMsg } ``` If `Import-LocalizedData` cannot find a `.psd1` file that matches the value of -`$PSUIculture`, the value of `$msgTable` is not replaced, and the call to +`$PSUICulture`, the value of `$msgTable` is not replaced, and the call to `$msgTable.promptMsg` displays the fallback en-US strings. ## Examples diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md index 2fa5f7f8fc26..9f8ef8b00d6f 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -305,12 +305,12 @@ function and the `$ProfileName` variable. function New-Profile { Write-Host "Running New-Profile function" - $profileName = Split-Path $profile -Leaf + $profileName = Split-Path $PROFILE -Leaf - if (Test-Path $profile) + if (Test-Path $PROFILE) {Write-Error "Profile $profileName already exists on this computer."} else - {New-Item -Type file -Path $profile -Force } + {New-Item -Type file -Path $PROFILE -Force } } ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md index 626270053301..623db4d2ae62 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md @@ -206,7 +206,7 @@ active copy of the session configuration file. When you use a session configuration file in a session configuration, PowerShell creates an active copy of the session configuration file and stores -it in the \$pshome\\SessionConfig directory on the local computer. +it in the \$PSHOME\\SessionConfig directory on the local computer. The location of the active copy of a session configuration file is stored in the ConfigFilePath property of the session configuration object. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md index bf3c6ceab4ed..5f3d8c106d1c 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -72,7 +72,7 @@ table of parameter-name and parameter-value pairs and stores it in the variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. -To provide a value for the **WhatIf** switch parameter, use `$True` or +To provide a value for the **WhatIf** switch parameter, use `$true` or `$false`. ```powershell diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 3eeb150a8107..91f0e4869145 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -73,7 +73,7 @@ The **Boolean** type operators (`-is` and `-isnot`) always return a **Boolean** value, even if the input is a collection of objects. If `` is a type that is the same as or is _derived_ from the .NET Type, -the `-is` operator returns `$True`. +the `-is` operator returns `$true`. For example, the **DirectoryInfo** type is derived from the **FileSystemInfo** type. Therefore, both of these examples return **True**. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Updatable_Help.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Updatable_Help.md index 5d6693f3fce0..e06f5c3393a4 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Updatable_Help.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Updatable_Help.md @@ -133,7 +133,7 @@ Update-Help -Module Microsoft.PowerShell.Security ## Permissions for updatable help -To update help for the modules in the directory `$pshome/Modules`, you must be +To update help for the modules in the directory `$PSHOME/Modules`, you must be member of the Administrators group on the computer. If you aren't a member of the Administrators group, you can't update help for diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Object_Creation.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Object_Creation.md index 2b201da9b14f..7a9606157299 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Object_Creation.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Object_Creation.md @@ -247,7 +247,7 @@ For example, the following command creates a session option object. ```powershell [System.Management.Automation.Remoting.PSSessionOption]@{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } ``` @@ -287,7 +287,7 @@ cmdlet can be a hash table. ```powershell New-PSSession -ComputerName Server01 -SessionOption @{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } Register-ScheduledJob -Name Test -FilePath .\Get-Inventory.ps1 -Trigger @{ Frequency="Daily" diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md index 85412ae8ab71..a2975ef8898b 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -74,7 +74,7 @@ For example: ``` ```Output -"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -115,7 +115,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md index 7b4a7cab38c4..dbe93639b02c 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$false` if +that contains `$true` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index fa85628eeb86..5b4b3b555803 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -312,7 +312,7 @@ reproduced exactly. For example: ```powershell @' -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. '@ ``` @@ -320,7 +320,7 @@ of your PowerShell profile. The output of this command is: ```Output -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. ``` @@ -331,7 +331,7 @@ example: @" Even if you have not created a profile, the path of the profile file is: -$profile. +$PROFILE. "@ ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md index 8a3b78ec6e35..f4e86cef8490 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md @@ -160,7 +160,7 @@ if (!($username)) { $msgTable.promptMsg } ``` If `Import-LocalizedData` cannot find a `.psd1` file that matches the value of -`$PSUIculture`, the value of `$msgTable` is not replaced, and the call to +`$PSUICulture`, the value of `$msgTable` is not replaced, and the call to `$msgTable.promptMsg` displays the fallback en-US strings. ## Examples diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md index 67103599e6a2..1d1dff0b2c5b 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -305,12 +305,12 @@ function and the `$ProfileName` variable. function New-Profile { Write-Host "Running New-Profile function" - $profileName = Split-Path $profile -Leaf + $profileName = Split-Path $PROFILE -Leaf - if (Test-Path $profile) + if (Test-Path $PROFILE) {Write-Error "Profile $profileName already exists on this computer."} else - {New-Item -Type file -Path $profile -Force } + {New-Item -Type file -Path $PROFILE -Force } } ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md index ab30485f99d2..cbfa59e76e41 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md @@ -207,7 +207,7 @@ active copy of the session configuration file. When you use a session configuration file in a session configuration, PowerShell creates an active copy of the session configuration file and stores -it in the \$pshome\\SessionConfig directory on the local computer. +it in the \$PSHOME\\SessionConfig directory on the local computer. The location of the active copy of a session configuration file is stored in the ConfigFilePath property of the session configuration object. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md index dff6794765ff..65ba92fd5ca4 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -72,7 +72,7 @@ table of parameter-name and parameter-value pairs and stores it in the variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. -To provide a value for the **WhatIf** switch parameter, use `$True` or +To provide a value for the **WhatIf** switch parameter, use `$true` or `$false`. ```powershell diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 86ee04aaf949..68b7695acea7 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -74,7 +74,7 @@ The **Boolean** type operators (`-is` and `-isnot`) always return a **Boolean** value, even if the input is a collection of objects. If `` is a type that is the same as or is _derived_ from the .NET Type, -the `-is` operator returns `$True`. +the `-is` operator returns `$true`. For example, the **DirectoryInfo** type is derived from the **FileSystemInfo** type. Therefore, both of these examples return **True**. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Updatable_Help.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Updatable_Help.md index ffcd67cd7b61..8325801ec398 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Updatable_Help.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Updatable_Help.md @@ -133,7 +133,7 @@ Update-Help -Module Microsoft.PowerShell.Security ## Permissions for updatable help -To update help for the modules in the directory `$pshome/Modules`, you must be +To update help for the modules in the directory `$PSHOME/Modules`, you must be member of the Administrators group on the computer. If you aren't a member of the Administrators group, you can't update help for diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Object_Creation.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Object_Creation.md index 60d49fc4ae42..dfea41cb1895 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Object_Creation.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Object_Creation.md @@ -247,7 +247,7 @@ For example, the following command creates a session option object. ```powershell [System.Management.Automation.Remoting.PSSessionOption]@{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } ``` @@ -287,7 +287,7 @@ cmdlet can be a hash table. ```powershell New-PSSession -ComputerName Server01 -SessionOption @{ IdleTimeout=43200000 - SkipCnCheck=$True + SkipCnCheck=$true } Register-ScheduledJob -Name Test -FilePath .\Get-Inventory.ps1 -Trigger @{ Frequency="Daily" diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md index ebeb1691f192..354aa90bcab7 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -74,7 +74,7 @@ For example: ``` ```Output -"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) " +"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) " # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml @@ -115,7 +115,7 @@ PowerShell includes a built-in `Prompt` function. ```powershell function prompt { - "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1)) "; # .Link # https://go.microsoft.com/fwlink/?LinkID=225750 # .ExternalHelp System.Management.Automation.dll-help.xml diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md index a2c571f916bb..f705141e7850 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Properties.md @@ -28,7 +28,7 @@ object, the file changes too. Most objects have properties. Properties are the data that are associated with an object. Different types of object have different properties. For example, a **FileInfo** object, which represents a file, has an **IsReadOnly** property -that contains `$True` if the file has the read-only attribute and `$false` if +that contains `$true` if the file has the read-only attribute and `$false` if it doesn't. A **DirectoryInfo** object, which represents a file system directory, has a **Parent** property that contains the path to the parent directory. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index 36faaaa15ab0..83565a666872 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -312,7 +312,7 @@ reproduced exactly. For example: ```powershell @' -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. '@ ``` @@ -320,7 +320,7 @@ of your PowerShell profile. The output of this command is: ```Output -The $profile variable contains the path +The $PROFILE variable contains the path of your PowerShell profile. ``` @@ -331,7 +331,7 @@ example: @" Even if you have not created a profile, the path of the profile file is: -$profile. +$PROFILE. "@ ``` diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md index 383da941e797..7b0ce3b9dcc7 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Script_Internationalization.md @@ -160,7 +160,7 @@ if (!($username)) { $msgTable.promptMsg } ``` If `Import-LocalizedData` cannot find a `.psd1` file that matches the value of -`$PSUIculture`, the value of `$msgTable` is not replaced, and the call to +`$PSUICulture`, the value of `$msgTable` is not replaced, and the call to `$msgTable.promptMsg` displays the fallback en-US strings. ## Examples diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md index 1e69a5aea97b..dc3faea15502 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -305,12 +305,12 @@ function and the `$ProfileName` variable. function New-Profile { Write-Host "Running New-Profile function" - $profileName = Split-Path $profile -Leaf + $profileName = Split-Path $PROFILE -Leaf - if (Test-Path $profile) + if (Test-Path $PROFILE) {Write-Error "Profile $profileName already exists on this computer."} else - {New-Item -Type file -Path $profile -Force } + {New-Item -Type file -Path $PROFILE -Force } } ``` diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md index d4b08274c0c5..823d350812b2 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Session_Configuration_Files.md @@ -206,7 +206,7 @@ active copy of the session configuration file. When you use a session configuration file in a session configuration, PowerShell creates an active copy of the session configuration file and stores -it in the \$pshome\\SessionConfig directory on the local computer. +it in the \$PSHOME\\SessionConfig directory on the local computer. The location of the active copy of a session configuration file is stored in the ConfigFilePath property of the session configuration object. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md index b41251bc70f3..b8ca2758f9ee 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -72,7 +72,7 @@ table of parameter-name and parameter-value pairs and stores it in the variable in a command with splatting. The At symbol (`@HashArguments`) replaces the dollar sign (`$HashArguments`) in the command. -To provide a value for the **WhatIf** switch parameter, use `$True` or +To provide a value for the **WhatIf** switch parameter, use `$true` or `$false`. ```powershell diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Operators.md index 6fbe160cbb24..c6012b3478b0 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -74,7 +74,7 @@ The **Boolean** type operators (`-is` and `-isnot`) always return a **Boolean** value, even if the input is a collection of objects. If `` is a type that is the same as or is _derived_ from the .NET Type, -the `-is` operator returns `$True`. +the `-is` operator returns `$true`. For example, the **DirectoryInfo** type is derived from the **FileSystemInfo** type. Therefore, both of these examples return **True**. diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Updatable_Help.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Updatable_Help.md index 6e887b429293..c4ba415ee117 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Updatable_Help.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Updatable_Help.md @@ -133,7 +133,7 @@ Update-Help -Module Microsoft.PowerShell.Security ## Permissions for updatable help -To update help for the modules in the directory `$pshome/Modules`, you must be +To update help for the modules in the directory `$PSHOME/Modules`, you must be member of the Administrators group on the computer. If you aren't a member of the Administrators group, you can't update help for From def7e34ab009db1d59bc76569e783959f249d32c Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:19:11 +0000 Subject: [PATCH 10/16] Fix automatic variable case (#11832) --- .../About/about_Variable_Provider.md | 2 +- .../5.1/Microsoft.PowerShell.Core/Enable-PSRemoting.md | 4 ++-- reference/5.1/Microsoft.PowerShell.Core/Get-Job.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Get-Module.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/New-ModuleManifest.md | 4 ++-- .../New-PSSessionConfigurationFile.md | 4 ++-- .../5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md | 2 +- .../5.1/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Save-Help.md | 6 +++--- .../About/about_Variable_Provider.md | 2 +- .../7.4/Microsoft.PowerShell.Core/Enable-PSRemoting.md | 2 +- reference/7.4/Microsoft.PowerShell.Core/Get-Job.md | 2 +- reference/7.4/Microsoft.PowerShell.Core/Get-Module.md | 2 +- reference/7.4/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/New-ModuleManifest.md | 4 ++-- .../New-PSSessionConfigurationFile.md | 4 ++-- .../7.4/Microsoft.PowerShell.Core/New-PSSessionOption.md | 2 +- .../7.4/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- reference/7.4/Microsoft.PowerShell.Core/Save-Help.md | 6 +++--- .../About/about_Variable_Provider.md | 2 +- .../7.5/Microsoft.PowerShell.Core/Enable-PSRemoting.md | 2 +- reference/7.5/Microsoft.PowerShell.Core/Get-Job.md | 2 +- reference/7.5/Microsoft.PowerShell.Core/Get-Module.md | 2 +- reference/7.5/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/New-ModuleManifest.md | 4 ++-- .../New-PSSessionConfigurationFile.md | 4 ++-- .../7.5/Microsoft.PowerShell.Core/New-PSSessionOption.md | 2 +- .../7.5/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- reference/7.5/Microsoft.PowerShell.Core/Save-Help.md | 6 +++--- .../About/about_Variable_Provider.md | 2 +- .../7.6/Microsoft.PowerShell.Core/Enable-PSRemoting.md | 2 +- reference/7.6/Microsoft.PowerShell.Core/Get-Job.md | 2 +- reference/7.6/Microsoft.PowerShell.Core/Get-Module.md | 2 +- reference/7.6/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/New-ModuleManifest.md | 4 ++-- .../New-PSSessionConfigurationFile.md | 4 ++-- .../7.6/Microsoft.PowerShell.Core/New-PSSessionOption.md | 2 +- .../7.6/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- reference/7.6/Microsoft.PowerShell.Core/Save-Help.md | 6 +++--- 40 files changed, 61 insertions(+), 61 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Variable_Provider.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Variable_Provider.md index 87daa068c640..54f65c269f15 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Variable_Provider.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Variable_Provider.md @@ -130,7 +130,7 @@ the dollar sign (`$`). This has the same effect as prefixing the variables name with the dollar sign (`$`). ```powershell -$variable:home +$variable:HOME ``` ### Get variables using wildcards diff --git a/reference/5.1/Microsoft.PowerShell.Core/Enable-PSRemoting.md b/reference/5.1/Microsoft.PowerShell.Core/Enable-PSRemoting.md index a1b3dd521f06..e2178ecc988e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Enable-PSRemoting.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Enable-PSRemoting.md @@ -219,7 +219,7 @@ This cmdlet returns strings that describe its results. ## NOTES Starting in PowerShell 3.0, `Enable-PSRemoting` enables all session configurations by setting the -value of the **Enabled** property of all session configurations to `$True`. +value of the **Enabled** property of all session configurations to `$true`. - On server versions of the Windows operating system, `Enable-PSRemoting` creates firewall rules for private and domain networks that allow remote access, and creates a firewall rule for public @@ -236,7 +236,7 @@ value of the **Enabled** property of all session configurations to `$True`. `Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any` `Enable-PSRemoting` enables all session configurations by setting the value of the **Enabled** -property of all session configurations to `$True`. +property of all session configurations to `$true`. `Enable-PSRemoting` removes the **Deny_All** and **Network_Deny_All** settings. This provides remote access to session configurations that were reserved for local use. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md index 311f17db9e94..50ed27f11f23 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Job.md @@ -547,7 +547,7 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current -session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not +session. To get jobs that have more results, specify a value of `$true`. To get jobs that do not have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md index 6f6e3ce9f7a5..16c491264705 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md @@ -266,7 +266,7 @@ Get-Content $m.Path CLRVersion = "2.0" NestedModules = "Microsoft.BackgroundIntelligentTransfer.Management" FormatsToProcess = "FileTransfer.Format.ps1xml" - RequiredAssemblies = Join-Path $psScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" + RequiredAssemblies = Join-Path $PSScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" } ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md index fa99f3952616..2c67fdf73436 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md @@ -1080,7 +1080,7 @@ Accept wildcard characters: False Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects. -When using the **InputObject** parameter, use the `$Input` automatic variable in the value of the +When using the **InputObject** parameter, use the `$input` automatic variable in the value of the **ScriptBlock** parameter to represent the input objects. ```yaml @@ -1375,7 +1375,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Management.Automation.ScriptBlock -You can pipe a command in a script block to `Invoke-Command`. Use the `$Input` automatic variable to +You can pipe a command in a script block to `Invoke-Command`. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/5.1/Microsoft.PowerShell.Core/New-ModuleManifest.md index 03cb476fc7b3..cbec9150ce88 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -772,7 +772,7 @@ Accept wildcard characters: False ### -Path Specifies the path and file name of the new module manifest. Enter a path and file name with a -`.psd1` file name extension, such as `$pshome\Modules\MyModule\MyModule.psd1`. The **Path** +`.psd1` file name extension, such as `$PSHOME\Modules\MyModule\MyModule.psd1`. The **Path** parameter is required. If you specify the path to an existing file, `New-ModuleManifest` replaces the file without warning @@ -1136,7 +1136,7 @@ manifest. Module manifests are usually optional. However, a module manifest is required to export an assembly that is installed in the global assembly cache. -To add or change files in the `$pshome\Modules` directory, start PowerShell with the **Run as +To add or change files in the `$PSHOME\Modules` directory, start PowerShell with the **Run as administrator** option. In PowerShell 2.0, many parameters of `New-ModuleManifest` were mandatory, even though they weren't diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index 3f4cea9c24b7..287ce0291b49 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -169,7 +169,7 @@ True ``` Use the **Verbose** parameter with `Test-PSSessionConfigurationFile` to display any errors that are -detected. The cmdlet returns `$True` if no errors are detected in the file. +detected. The cmdlet returns `$true` if no errors are detected in the file. ### Example 5: Create a sample configuration file @@ -583,7 +583,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$true`, `$false`, and `$null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md index bde29c06f8b6..7820f2840c83 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -314,7 +314,7 @@ Specifies the culture to use for the session. Enter a culture name in `-` format (like `ja-JP`), a variable that contains a **CultureInfo** object, or a command that gets a **CultureInfo** object. -The default value is `$Null`, and the culture that is set in the operating system is used in the +The default value is `$null`, and the culture that is set in the operating system is used in the session. ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md index 6faaf01adc4e..f6af4b6f8020 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -248,7 +248,7 @@ disconnected and get the results of jobs that were running in the sessions. ``` PS> $parms = @{ - InDisconnectedSession = $True + InDisconnectedSession = $true ComputerName = "Server01", "Server02", "Server30" FilePath = "\\Server12\Scripts\SharedScripts\Get-BugStatus.ps1" Name = "BugStatus" diff --git a/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md index 531ec6d02a3a..ed3bbe6779b8 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md @@ -69,7 +69,7 @@ cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XM then installs the help files and the help information file in a language-specific subfolder of the module folder. -To save the help files for modules in the PowerShell installation folder (`$pshome\Modules`), start +To save the help files for modules in the PowerShell installation folder (`$PSHOME\Modules`), start PowerShell by using the Run as administrator option. You must be a member of the Administrators group on the computer to download the help files for these modules. @@ -441,9 +441,9 @@ This cmdlet returns no output. ## NOTES -- To save help for modules in the $pshome\Modules folder, start PowerShell by using the Run as +- To save help for modules in the $PSHOME\Modules folder, start PowerShell by using the Run as administrator option. Only members of the Administrators group on the computer can download help - for modules in the $pshome\Modules folder. + for modules in the $PSHOME\Modules folder. - The saved help for each module consists of one help information (HelpInfo XML) file and one cabinet (.cab) file for the help files each UI culture. You do not have to extract the help files from the cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XML, and diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Variable_Provider.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Variable_Provider.md index 65b493d5c996..598e44050679 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Variable_Provider.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Variable_Provider.md @@ -130,7 +130,7 @@ the dollar sign (`$`). This has the same effect as prefixing the variables name with the dollar sign (`$`). ```powershell -$variable:home +$variable:HOME ``` ### Get variables using wildcards diff --git a/reference/7.4/Microsoft.PowerShell.Core/Enable-PSRemoting.md b/reference/7.4/Microsoft.PowerShell.Core/Enable-PSRemoting.md index 139600585182..1a19be2b001e 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Enable-PSRemoting.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Enable-PSRemoting.md @@ -333,7 +333,7 @@ networks that removes the local subnet restriction and allows remote access , us `Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any` `Enable-PSRemoting` enables all session configurations by setting the value of the **Enabled** -property of all session configurations to `$True`. +property of all session configurations to `$true`. `Enable-PSRemoting` removes the **Deny_All** and **Network_Deny_All** settings. This provides remote access to session configurations that were reserved for local use. diff --git a/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md b/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md index 405bff693139..0d55db57dcf9 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Get-Job.md @@ -547,7 +547,7 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current -session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not +session. To get jobs that have more results, specify a value of `$true`. To get jobs that do not have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. diff --git a/reference/7.4/Microsoft.PowerShell.Core/Get-Module.md b/reference/7.4/Microsoft.PowerShell.Core/Get-Module.md index 678e2b49ccc8..ddce290ee0fe 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Get-Module.md @@ -267,7 +267,7 @@ Get-Content $m.Path CLRVersion = "2.0" NestedModules = "Microsoft.BackgroundIntelligentTransfer.Management" FormatsToProcess = "FileTransfer.Format.ps1xml" - RequiredAssemblies = Join-Path $psScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" + RequiredAssemblies = Join-Path $PSScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" } ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/7.4/Microsoft.PowerShell.Core/Invoke-Command.md index 84481932cd0b..1516ff7f070d 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Invoke-Command.md @@ -1228,7 +1228,7 @@ Accept wildcard characters: False Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects. -When using the **InputObject** parameter, use the `$Input` automatic variable in the value of the +When using the **InputObject** parameter, use the `$input` automatic variable in the value of the **ScriptBlock** parameter to represent the input objects. ```yaml @@ -1689,7 +1689,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Management.Automation.ScriptBlock -You can pipe a command in a script block to `Invoke-Command`. Use the `$Input` automatic variable to +You can pipe a command in a script block to `Invoke-Command`. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/7.4/Microsoft.PowerShell.Core/New-ModuleManifest.md index 66dab5b82b8e..2fb759c2159c 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/7.4/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -801,7 +801,7 @@ Accept wildcard characters: False ### -Path Specifies the path and file name of the new module manifest. Enter a path and file name with a -`.psd1` file name extension, such as `$pshome\Modules\MyModule\MyModule.psd1`. The **Path** +`.psd1` file name extension, such as `$PSHOME\Modules\MyModule\MyModule.psd1`. The **Path** parameter is required. If you specify the path to an existing file, `New-ModuleManifest` replaces the file without warning @@ -1202,7 +1202,7 @@ files encoded as **UTF8NoBOM**. Module manifests are usually optional. However, a module manifest is required to export an assembly that is installed in the global assembly cache. -To add or change files in the `$pshome\Modules` directory, start PowerShell with the **Run as +To add or change files in the `$PSHOME\Modules` directory, start PowerShell with the **Run as administrator** option. > [!NOTE] diff --git a/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index d8a9f45fe785..8306e83e1dad 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -171,7 +171,7 @@ True ``` Use the **Verbose** parameter with `Test-PSSessionConfigurationFile` to display any errors that are -detected. The cmdlet returns `$True` if no errors are detected in the file. +detected. The cmdlet returns `$true` if no errors are detected in the file. ### Example 5: Create a sample configuration file @@ -585,7 +585,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$true`, `$false`, and `$null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionOption.md index a1649b23e2fb..df9f6b1bf99a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/7.4/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -314,7 +314,7 @@ Specifies the culture to use for the session. Enter a culture name in `-` format (like `ja-JP`), a variable that contains a **CultureInfo** object, or a command that gets a **CultureInfo** object. -The default value is `$Null`, and the culture that is set in the operating system is used in the +The default value is `$null`, and the culture that is set in the operating system is used in the session. ```yaml diff --git a/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md index 6da445c8bc98..7404fdcd5520 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -250,7 +250,7 @@ disconnected and get the results of jobs that were running in the sessions. ``` PS> $parms = @{ - InDisconnectedSession = $True + InDisconnectedSession = $true ComputerName = "Server01", "Server02", "Server30" FilePath = "\\Server12\Scripts\SharedScripts\Get-BugStatus.ps1" Name = "BugStatus" diff --git a/reference/7.4/Microsoft.PowerShell.Core/Save-Help.md b/reference/7.4/Microsoft.PowerShell.Core/Save-Help.md index 3537e03a4be7..17d428e7023f 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Save-Help.md @@ -71,7 +71,7 @@ cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XM then installs the help files and the help information file in a language-specific subfolder of the module folder. -To save the help files for modules in the PowerShell installation folder (`$pshome\Modules`), start +To save the help files for modules in the PowerShell installation folder (`$PSHOME\Modules`), start PowerShell by using the Run as administrator option. You must be a member of the Administrators group on the computer to download the help files for these modules. @@ -461,9 +461,9 @@ This cmdlet returns no output. ## NOTES -- To save help for modules in the $pshome\Modules folder, start PowerShell by using the Run as +- To save help for modules in the $PSHOME\Modules folder, start PowerShell by using the Run as administrator option. Only members of the Administrators group on the computer can download help - for modules in the $pshome\Modules folder. + for modules in the $PSHOME\Modules folder. - The saved help for each module consists of one help information (HelpInfo XML) file and one cabinet (.cab) file for the help files each UI culture. You do not have to extract the help files from the cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XML, and diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Variable_Provider.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Variable_Provider.md index bc719778d60c..f2a8fb88965a 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Variable_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Variable_Provider.md @@ -130,7 +130,7 @@ the dollar sign (`$`). This has the same effect as prefixing the variables name with the dollar sign (`$`). ```powershell -$variable:home +$variable:HOME ``` ### Get variables using wildcards diff --git a/reference/7.5/Microsoft.PowerShell.Core/Enable-PSRemoting.md b/reference/7.5/Microsoft.PowerShell.Core/Enable-PSRemoting.md index 635fb4c05fd1..ab96f96326b9 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Enable-PSRemoting.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Enable-PSRemoting.md @@ -333,7 +333,7 @@ networks that removes the local subnet restriction and allows remote access , us `Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any` `Enable-PSRemoting` enables all session configurations by setting the value of the **Enabled** -property of all session configurations to `$True`. +property of all session configurations to `$true`. `Enable-PSRemoting` removes the **Deny_All** and **Network_Deny_All** settings. This provides remote access to session configurations that were reserved for local use. diff --git a/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md b/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md index db59e6501c83..9a228bf5b4bd 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Get-Job.md @@ -547,7 +547,7 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current -session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not +session. To get jobs that have more results, specify a value of `$true`. To get jobs that do not have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. diff --git a/reference/7.5/Microsoft.PowerShell.Core/Get-Module.md b/reference/7.5/Microsoft.PowerShell.Core/Get-Module.md index f1589cab4314..a4febae3cae6 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Get-Module.md @@ -267,7 +267,7 @@ Get-Content $m.Path CLRVersion = "2.0" NestedModules = "Microsoft.BackgroundIntelligentTransfer.Management" FormatsToProcess = "FileTransfer.Format.ps1xml" - RequiredAssemblies = Join-Path $psScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" + RequiredAssemblies = Join-Path $PSScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" } ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/7.5/Microsoft.PowerShell.Core/Invoke-Command.md index a959361e9117..5875a64cc73c 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Invoke-Command.md @@ -1228,7 +1228,7 @@ Accept wildcard characters: False Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects. -When using the **InputObject** parameter, use the `$Input` automatic variable in the value of the +When using the **InputObject** parameter, use the `$input` automatic variable in the value of the **ScriptBlock** parameter to represent the input objects. ```yaml @@ -1689,7 +1689,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Management.Automation.ScriptBlock -You can pipe a command in a script block to `Invoke-Command`. Use the `$Input` automatic variable to +You can pipe a command in a script block to `Invoke-Command`. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/7.5/Microsoft.PowerShell.Core/New-ModuleManifest.md index 6e9408a7b29b..14806325b96b 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/7.5/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -810,7 +810,7 @@ Accept wildcard characters: False ### -Path Specifies the path and file name of the new module manifest. Enter a path and file name with a -`.psd1` file name extension, such as `$pshome\Modules\MyModule\MyModule.psd1`. The **Path** +`.psd1` file name extension, such as `$PSHOME\Modules\MyModule\MyModule.psd1`. The **Path** parameter is required. If you specify the path to an existing file, `New-ModuleManifest` replaces the file without warning @@ -1211,7 +1211,7 @@ files encoded as **UTF8NoBOM**. Module manifests are usually optional. However, a module manifest is required to export an assembly that is installed in the global assembly cache. -To add or change files in the `$pshome\Modules` directory, start PowerShell with the **Run as +To add or change files in the `$PSHOME\Modules` directory, start PowerShell with the **Run as administrator** option. > [!NOTE] diff --git a/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index 49e097f22546..3527f0408d63 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -171,7 +171,7 @@ True ``` Use the **Verbose** parameter with `Test-PSSessionConfigurationFile` to display any errors that are -detected. The cmdlet returns `$True` if no errors are detected in the file. +detected. The cmdlet returns `$true` if no errors are detected in the file. ### Example 5: Create a sample configuration file @@ -589,7 +589,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$true`, `$false`, and `$null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionOption.md index 16f294cf69de..203f78500a72 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/7.5/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -314,7 +314,7 @@ Specifies the culture to use for the session. Enter a culture name in `-` format (like `ja-JP`), a variable that contains a **CultureInfo** object, or a command that gets a **CultureInfo** object. -The default value is `$Null`, and the culture that is set in the operating system is used in the +The default value is `$null`, and the culture that is set in the operating system is used in the session. ```yaml diff --git a/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md index bab8bd805c80..459df57b3986 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -250,7 +250,7 @@ disconnected and get the results of jobs that were running in the sessions. ```powershell PS> $parms = @{ - InDisconnectedSession = $True + InDisconnectedSession = $true ComputerName = "Server01", "Server02", "Server30" FilePath = "\\Server12\Scripts\SharedScripts\Get-BugStatus.ps1" Name = "BugStatus" diff --git a/reference/7.5/Microsoft.PowerShell.Core/Save-Help.md b/reference/7.5/Microsoft.PowerShell.Core/Save-Help.md index 909875dfa49d..1d1e02f67a94 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Save-Help.md @@ -71,7 +71,7 @@ cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XM then installs the help files and the help information file in a language-specific subfolder of the module folder. -To save the help files for modules in the PowerShell installation folder (`$pshome\Modules`), start +To save the help files for modules in the PowerShell installation folder (`$PSHOME\Modules`), start PowerShell by using the Run as administrator option. You must be a member of the Administrators group on the computer to download the help files for these modules. @@ -464,9 +464,9 @@ This cmdlet returns no output. ## NOTES -- To save help for modules in the $pshome\Modules folder, start PowerShell by using the Run as +- To save help for modules in the $PSHOME\Modules folder, start PowerShell by using the Run as administrator option. Only members of the Administrators group on the computer can download help - for modules in the $pshome\Modules folder. + for modules in the $PSHOME\Modules folder. - The saved help for each module consists of one help information (HelpInfo XML) file and one cabinet (.cab) file for the help files each UI culture. You do not have to extract the help files from the cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XML, and diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Variable_Provider.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Variable_Provider.md index a33e0164500d..c156e2539edc 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Variable_Provider.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Variable_Provider.md @@ -130,7 +130,7 @@ the dollar sign (`$`). This has the same effect as prefixing the variables name with the dollar sign (`$`). ```powershell -$variable:home +$variable:HOME ``` ### Get variables using wildcards diff --git a/reference/7.6/Microsoft.PowerShell.Core/Enable-PSRemoting.md b/reference/7.6/Microsoft.PowerShell.Core/Enable-PSRemoting.md index 716dcd12c4d9..84b4decea530 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Enable-PSRemoting.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Enable-PSRemoting.md @@ -333,7 +333,7 @@ networks that removes the local subnet restriction and allows remote access , us `Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any` `Enable-PSRemoting` enables all session configurations by setting the value of the **Enabled** -property of all session configurations to `$True`. +property of all session configurations to `$true`. `Enable-PSRemoting` removes the **Deny_All** and **Network_Deny_All** settings. This provides remote access to session configurations that were reserved for local use. diff --git a/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md b/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md index e71c38131853..a0e6ae92b00c 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Get-Job.md @@ -546,7 +546,7 @@ Accept wildcard characters: False Indicates whether this cmdlet gets only jobs that have the specified **HasMoreData** property value. The **HasMoreData** property indicates whether all job results have been received in the current -session. To get jobs that have more results, specify a value of `$True`. To get jobs that do not +session. To get jobs that have more results, specify a value of `$true`. To get jobs that do not have more results, specify a value of `$false`. To get the results of a job, use the `Receive-Job` cmdlet. diff --git a/reference/7.6/Microsoft.PowerShell.Core/Get-Module.md b/reference/7.6/Microsoft.PowerShell.Core/Get-Module.md index 9b71ff4b202f..9be3fa121b60 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Get-Module.md @@ -267,7 +267,7 @@ Get-Content $m.Path CLRVersion = "2.0" NestedModules = "Microsoft.BackgroundIntelligentTransfer.Management" FormatsToProcess = "FileTransfer.Format.ps1xml" - RequiredAssemblies = Join-Path $psScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" + RequiredAssemblies = Join-Path $PSScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" } ``` diff --git a/reference/7.6/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/7.6/Microsoft.PowerShell.Core/Invoke-Command.md index 563e68da62a9..98caa1d4855d 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Invoke-Command.md @@ -1228,7 +1228,7 @@ Accept wildcard characters: False Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects. -When using the **InputObject** parameter, use the `$Input` automatic variable in the value of the +When using the **InputObject** parameter, use the `$input` automatic variable in the value of the **ScriptBlock** parameter to represent the input objects. ```yaml @@ -1689,7 +1689,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Management.Automation.ScriptBlock -You can pipe a command in a script block to `Invoke-Command`. Use the `$Input` automatic variable to +You can pipe a command in a script block to `Invoke-Command`. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/7.6/Microsoft.PowerShell.Core/New-ModuleManifest.md index 3794c2e93bad..270e9624758c 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/7.6/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -801,7 +801,7 @@ Accept wildcard characters: False ### -Path Specifies the path and file name of the new module manifest. Enter a path and file name with a -`.psd1` file name extension, such as `$pshome\Modules\MyModule\MyModule.psd1`. The **Path** +`.psd1` file name extension, such as `$PSHOME\Modules\MyModule\MyModule.psd1`. The **Path** parameter is required. If you specify the path to an existing file, `New-ModuleManifest` replaces the file without warning @@ -1202,7 +1202,7 @@ files encoded as **UTF8NoBOM**. Module manifests are usually optional. However, a module manifest is required to export an assembly that is installed in the global assembly cache. -To add or change files in the `$pshome\Modules` directory, start PowerShell with the **Run as +To add or change files in the `$PSHOME\Modules` directory, start PowerShell with the **Run as administrator** option. > [!NOTE] diff --git a/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md b/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md index 908a32d582a0..c08ccd116382 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md +++ b/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionConfigurationFile.md @@ -171,7 +171,7 @@ True ``` Use the **Verbose** parameter with `Test-PSSessionConfigurationFile` to display any errors that are -detected. The cmdlet returns `$True` if no errors are detected in the file. +detected. The cmdlet returns `$true` if no errors are detected in the file. ### Example 5: Create a sample configuration file @@ -585,7 +585,7 @@ The acceptable values for this parameter are: elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, - `$True`, `$false`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, + `$true`, `$false`, and `$null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted. The default value of the **LanguageMode** parameter depends on the value of the **SessionType** diff --git a/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionOption.md index 65d25ccb306a..8672a06d8cc2 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/7.6/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -314,7 +314,7 @@ Specifies the culture to use for the session. Enter a culture name in `-` format (like `ja-JP`), a variable that contains a **CultureInfo** object, or a command that gets a **CultureInfo** object. -The default value is `$Null`, and the culture that is set in the operating system is used in the +The default value is `$null`, and the culture that is set in the operating system is used in the session. ```yaml diff --git a/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md index b2d58e88e55e..d2aeb6bb518d 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -250,7 +250,7 @@ disconnected and get the results of jobs that were running in the sessions. ``` PS> $parms = @{ - InDisconnectedSession = $True + InDisconnectedSession = $true ComputerName = "Server01", "Server02", "Server30" FilePath = "\\Server12\Scripts\SharedScripts\Get-BugStatus.ps1" Name = "BugStatus" diff --git a/reference/7.6/Microsoft.PowerShell.Core/Save-Help.md b/reference/7.6/Microsoft.PowerShell.Core/Save-Help.md index 1861c1b88c3f..7deea985b17e 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Save-Help.md @@ -71,7 +71,7 @@ cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XM then installs the help files and the help information file in a language-specific subfolder of the module folder. -To save the help files for modules in the PowerShell installation folder (`$pshome\Modules`), start +To save the help files for modules in the PowerShell installation folder (`$PSHOME\Modules`), start PowerShell by using the Run as administrator option. You must be a member of the Administrators group on the computer to download the help files for these modules. @@ -461,9 +461,9 @@ This cmdlet returns no output. ## NOTES -- To save help for modules in the $pshome\Modules folder, start PowerShell by using the Run as +- To save help for modules in the $PSHOME\Modules folder, start PowerShell by using the Run as administrator option. Only members of the Administrators group on the computer can download help - for modules in the $pshome\Modules folder. + for modules in the $PSHOME\Modules folder. - The saved help for each module consists of one help information (HelpInfo XML) file and one cabinet (.cab) file for the help files each UI culture. You do not have to extract the help files from the cabinet file. The `Update-Help` cmdlet extracts the help files, validates the XML, and From 1142e36917f8f01a06057dad28fab7faf5d1d8f4 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:21:38 +0000 Subject: [PATCH 11/16] Fix automatic variable case (#11833) --- .../Set-PSSessionConfiguration.md | 8 ++++---- .../5.1/Microsoft.PowerShell.Core/Set-StrictMode.md | 8 ++++---- .../Microsoft.PowerShell.Core/Test-ModuleManifest.md | 10 +++++----- .../Test-PSSessionConfigurationFile.md | 2 +- .../5.1/Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../5.1/Microsoft.PowerShell.Management/Add-Content.md | 2 +- .../5.1/Microsoft.PowerShell.Management/Get-Process.md | 2 +- .../5.1/Microsoft.PowerShell.Management/New-Item.md | 8 ++++---- .../Microsoft.PowerShell.Management/Pop-Location.md | 2 +- .../Set-ItemProperty.md | 4 ++-- .../Set-PSSessionConfiguration.md | 8 ++++---- .../7.4/Microsoft.PowerShell.Core/Set-StrictMode.md | 8 ++++---- .../Microsoft.PowerShell.Core/Test-ModuleManifest.md | 10 +++++----- .../Test-PSSessionConfigurationFile.md | 2 +- .../7.4/Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../7.4/Microsoft.PowerShell.Management/Add-Content.md | 2 +- .../7.4/Microsoft.PowerShell.Management/Get-Process.md | 2 +- .../7.4/Microsoft.PowerShell.Management/New-Item.md | 8 ++++---- .../Microsoft.PowerShell.Management/Pop-Location.md | 2 +- .../Set-ItemProperty.md | 4 ++-- .../Set-PSSessionConfiguration.md | 8 ++++---- .../7.5/Microsoft.PowerShell.Core/Set-StrictMode.md | 8 ++++---- .../Microsoft.PowerShell.Core/Test-ModuleManifest.md | 10 +++++----- .../Test-PSSessionConfigurationFile.md | 2 +- .../7.5/Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../7.5/Microsoft.PowerShell.Management/Add-Content.md | 2 +- .../7.5/Microsoft.PowerShell.Management/Get-Process.md | 2 +- .../7.5/Microsoft.PowerShell.Management/New-Item.md | 8 ++++---- .../Microsoft.PowerShell.Management/Pop-Location.md | 2 +- .../Set-ItemProperty.md | 4 ++-- .../Set-PSSessionConfiguration.md | 8 ++++---- .../7.6/Microsoft.PowerShell.Core/Set-StrictMode.md | 8 ++++---- .../Microsoft.PowerShell.Core/Test-ModuleManifest.md | 10 +++++----- .../Test-PSSessionConfigurationFile.md | 2 +- .../7.6/Microsoft.PowerShell.Core/Where-Object.md | 2 +- .../7.6/Microsoft.PowerShell.Management/Add-Content.md | 2 +- .../7.6/Microsoft.PowerShell.Management/Get-Process.md | 2 +- .../7.6/Microsoft.PowerShell.Management/New-Item.md | 8 ++++---- .../Microsoft.PowerShell.Management/Pop-Location.md | 2 +- .../Set-ItemProperty.md | 4 ++-- 40 files changed, 96 insertions(+), 96 deletions(-) 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 From f45c51790b26e18156afc8b03aa405f40d6a770e Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:27:21 +0000 Subject: [PATCH 12/16] Fix automatic variable case (#11834) --- .../Microsoft.PowerShell.Management/Split-Path.md | 6 +++--- .../Microsoft.PowerShell.Management/Stop-Process.md | 2 +- .../Suspend-Service.md | 2 +- .../Test-Connection.md | 6 +++--- .../5.1/Microsoft.PowerShell.Management/Test-Path.md | 12 ++++++------ .../Microsoft.PowerShell.Security/Get-Credential.md | 2 +- .../Test-FileCatalog.md | 4 ++-- .../5.1/Microsoft.PowerShell.Utility/Add-Member.md | 4 ++-- .../5.1/Microsoft.PowerShell.Utility/Add-Type.md | 4 ++-- .../Microsoft.PowerShell.Utility/Compare-Object.md | 2 +- .../Microsoft.PowerShell.Management/Split-Path.md | 6 +++--- .../Microsoft.PowerShell.Management/Stop-Process.md | 2 +- .../Suspend-Service.md | 2 +- .../Test-Connection.md | 8 ++++---- .../7.4/Microsoft.PowerShell.Management/Test-Path.md | 12 ++++++------ .../Microsoft.PowerShell.Security/Get-Credential.md | 2 +- .../Test-FileCatalog.md | 4 ++-- .../7.4/Microsoft.PowerShell.Utility/Add-Member.md | 4 ++-- .../7.4/Microsoft.PowerShell.Utility/Add-Type.md | 4 ++-- .../Microsoft.PowerShell.Utility/Compare-Object.md | 2 +- .../Microsoft.PowerShell.Management/Split-Path.md | 6 +++--- .../Microsoft.PowerShell.Management/Stop-Process.md | 2 +- .../Suspend-Service.md | 2 +- .../Test-Connection.md | 8 ++++---- .../7.5/Microsoft.PowerShell.Management/Test-Path.md | 10 +++++----- .../Microsoft.PowerShell.Security/Get-Credential.md | 2 +- .../Test-FileCatalog.md | 4 ++-- .../7.5/Microsoft.PowerShell.Utility/Add-Member.md | 4 ++-- .../7.5/Microsoft.PowerShell.Utility/Add-Type.md | 4 ++-- .../Microsoft.PowerShell.Utility/Compare-Object.md | 2 +- .../Microsoft.PowerShell.Management/Split-Path.md | 6 +++--- .../Microsoft.PowerShell.Management/Stop-Process.md | 2 +- .../Suspend-Service.md | 2 +- .../Test-Connection.md | 8 ++++---- .../7.6/Microsoft.PowerShell.Management/Test-Path.md | 10 +++++----- .../Microsoft.PowerShell.Security/Get-Credential.md | 2 +- .../Test-FileCatalog.md | 4 ++-- .../7.6/Microsoft.PowerShell.Utility/Add-Member.md | 4 ++-- .../7.6/Microsoft.PowerShell.Utility/Add-Type.md | 4 ++-- .../Microsoft.PowerShell.Utility/Compare-Object.md | 2 +- 40 files changed, 89 insertions(+), 89 deletions(-) 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 ``` From 514b918c45dcd9593087259a9ded866cf75fc5d8 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:41:29 +0000 Subject: [PATCH 13/16] Fix automatic variable case (#11835) --- .../5.1/Microsoft.PowerShell.Utility/Export-Alias.md | 4 ++-- .../Microsoft.PowerShell.Utility/Export-Clixml.md | 4 ++-- .../5.1/Microsoft.PowerShell.Utility/Format-List.md | 2 +- .../5.1/Microsoft.PowerShell.Utility/Get-Culture.md | 4 ++-- .../Get-EventSubscriber.md | 2 +- .../5.1/Microsoft.PowerShell.Utility/Get-Member.md | 6 +++--- .../Microsoft.PowerShell.Utility/Import-Clixml.md | 4 ++-- .../Import-LocalizedData.md | 12 ++++++------ .../Invoke-Expression.md | 4 ++-- .../5.1/Microsoft.PowerShell.Utility/New-Object.md | 8 ++++---- .../7.4/Microsoft.PowerShell.Utility/Export-Alias.md | 4 ++-- .../Microsoft.PowerShell.Utility/Export-Clixml.md | 4 ++-- .../7.4/Microsoft.PowerShell.Utility/Format-List.md | 2 +- .../7.4/Microsoft.PowerShell.Utility/Get-Culture.md | 4 ++-- .../Get-EventSubscriber.md | 2 +- .../7.4/Microsoft.PowerShell.Utility/Get-Member.md | 6 +++--- .../Microsoft.PowerShell.Utility/Import-Clixml.md | 4 ++-- .../Import-LocalizedData.md | 12 ++++++------ .../Invoke-Expression.md | 4 ++-- .../7.4/Microsoft.PowerShell.Utility/New-Object.md | 8 ++++---- .../7.5/Microsoft.PowerShell.Utility/Export-Alias.md | 4 ++-- .../Microsoft.PowerShell.Utility/Export-Clixml.md | 4 ++-- .../7.5/Microsoft.PowerShell.Utility/Format-List.md | 2 +- .../7.5/Microsoft.PowerShell.Utility/Get-Culture.md | 4 ++-- .../Get-EventSubscriber.md | 2 +- .../7.5/Microsoft.PowerShell.Utility/Get-Member.md | 6 +++--- .../Microsoft.PowerShell.Utility/Import-Clixml.md | 4 ++-- .../Import-LocalizedData.md | 12 ++++++------ .../Invoke-Expression.md | 4 ++-- .../7.5/Microsoft.PowerShell.Utility/New-Object.md | 8 ++++---- .../7.6/Microsoft.PowerShell.Utility/Export-Alias.md | 4 ++-- .../Microsoft.PowerShell.Utility/Export-Clixml.md | 4 ++-- .../7.6/Microsoft.PowerShell.Utility/Format-List.md | 2 +- .../7.6/Microsoft.PowerShell.Utility/Get-Culture.md | 4 ++-- .../Get-EventSubscriber.md | 2 +- .../7.6/Microsoft.PowerShell.Utility/Get-Member.md | 6 +++--- .../Microsoft.PowerShell.Utility/Import-Clixml.md | 4 ++-- .../Import-LocalizedData.md | 12 ++++++------ .../Invoke-Expression.md | 4 ++-- .../7.6/Microsoft.PowerShell.Utility/New-Object.md | 8 ++++---- 40 files changed, 100 insertions(+), 100 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md index 95f7e31f7be5..815031bf091e 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md @@ -79,7 +79,7 @@ they have the read-only attribute. ```powershell Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $Profile -Value (Get-Content alias.ps1) +Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) $S = New-PSSession -ComputerName Server01 Invoke-Command -Session $S -FilePath .\alias.ps1 ``` @@ -91,7 +91,7 @@ parameter with a value of Script to generate a file that contains a Set-Alias co alias. The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. -The path to the profile is saved in the `$Profile` variable. The command uses the `Get-Content` +The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md index 1ba50aa4485c..c355fc75b2c6 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -84,9 +84,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > array. This provides some obfuscation but does not provide encryption. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md index cd465a6ad572..67c8f582cad3 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md @@ -48,7 +48,7 @@ default output cmdlet for display. These commands display information about the PS1XML files in the PowerShell directory as a list. ```powershell -$A = Get-ChildItem $pshome\*.ps1xml +$A = Get-ChildItem $PSHOME\*.ps1xml Format-List -InputObject $A ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Culture.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Culture.md index 1f0d8e00b742..8054284325b7 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Culture.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Culture.md @@ -161,8 +161,8 @@ This cmdlet returns a **CultureInfo** object representing the current culture. ## NOTES -You can also use the `$PsCulture` and `$PsUICulture` variables. The `$PsCulture` variable stores the -name of the current culture and the `$PsUICulture` variable stores the name of the current UI +You can also use the `$PSCulture` and `$PSUICulture` variables. The `$PSCulture` variable stores the +name of the current culture and the `$PSUICulture` variable stores the name of the current UI culture. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-EventSubscriber.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-EventSubscriber.md index bd90882222d4..f8c68c62ee17 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-EventSubscriber.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-EventSubscriber.md @@ -111,7 +111,7 @@ Id Name State HasMoreData Location Command ``` ```powershell -$Timer.Enabled = $True +$Timer.Enabled = $true $Subscriber = Get-EventSubscriber -SourceIdentifier Timer.Random ($Subscriber.action).gettype().fullname ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md index cef8b0a89d5e..3c30a57d5c08 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md @@ -502,9 +502,9 @@ Windows PowerShell includes the following aliases for `Get-Member`: You can get information about a collection object either using the **InputObject** parameter or by piping the object, preceded by a comma, to `Get-Member`. -You can use the `$This` automatic variable in script blocks that define the values of new properties -and methods. The `$This` variable refers to the instance of the object to which the properties and -methods are being added. For more information about the `$This` variable, see +You can use the `$this` automatic variable in script blocks that define the values of new properties +and methods. The `$this` variable refers to the instance of the object to which the properties and +methods are being added. For more information about the `$this` variable, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). If you pass an object representing a _type_, like a type literal such as `[int]`, `Get-Member` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md index 679629f27282..722c403484bd 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -74,9 +74,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > such as macOS and Linux, credentials are exported in plain text. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-LocalizedData.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-LocalizedData.md index 636a5154365d..db7094f74785 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-LocalizedData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-LocalizedData.md @@ -55,7 +55,7 @@ Import-LocalizedData -BindingVariable "Messages" ``` If the command is included in the Archives.ps1 script in the `C:\Test` directory, and the value of -the `$PsUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` +the `$PSUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` file in the `C:\test\zh-CN` directory into the `$Messages` variable. ### Example 2: Import localized data strings @@ -160,13 +160,13 @@ command that converts the contents of the DATA section to a hashtable and stores The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated text strings from the TestScript.psd1 file in the subdirectory specified by the value of the -`$PsUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from +`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the DATA section logic. The third command displays the first message in the `$UserMessages` variable. -If the `Import-LocalizedData` command finds a `.psd1` file for the `$PsUICulture` language, the +If the `Import-LocalizedData` command finds a `.psd1` file for the `$PSUICulture` language, the value of the `$UserMessages` variable contains the translated text strings. If the command fails for any reason, the command displays the default text strings defined in the DATA section of the script. @@ -301,14 +301,14 @@ Accept wildcard characters: False ### -UICulture -Specifies an alternate UI culture. The default is the value of the `$PsUICulture` automatic +Specifies an alternate UI culture. The default is the value of the `$PSUICulture` automatic variable. Enter a UI culture in `-` format, such as `en-US`, `de-DE`, or `ar-SA`. The value of the **UICulture** parameter determines the language-specific subdirectory (within the base directory) from which `Import-LocalizedData` gets the `.psd1` file for the script. The cmdlet searches for a subdirectory with the same name as the value of the **UICulture** -parameter or the `$PsUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the +parameter or the `$PSUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the directory, or the directory doesn't contain a `.psd1` file for the script, it searches for a subdirectory with the name of the language code, such as de or ar. If it can't find the subdirectory or `.psd1` file, the command fails and the data is displayed in the default language specified in @@ -363,7 +363,7 @@ parameter. `Import-LocalizedData` begins the search in the directory where the script file is located (or the value of the **BaseDirectory** parameter). It then searches within the base directory for a - subdirectory with the same name as the value of the `$PsUICulture` variable (or the value of the + subdirectory with the same name as the value of the `$PSUICulture` variable (or the value of the **UICulture** parameter), such as `de-DE` or `ar-SA`. Then, it searches in that subdirectory for a `.psd1` file with the same name as the script (or the value of the **FileName** parameter). diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-Expression.md b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-Expression.md index 06f84398aa89..6f113ff160a9 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-Expression.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-Expression.md @@ -145,12 +145,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.String -You can pipe a string representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe a string representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ### System.Management.Automation.PSObject -You can pipe an object representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe an object representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/New-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/New-Object.md index 18ed8b144f92..4eed27422f6d 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/New-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/New-Object.md @@ -56,16 +56,16 @@ Major Minor Build Revision This example creates two instances of the COM object that represents the Internet Explorer application. The first instance uses the **Property** parameter hash table to call the **Navigate2** -method and set the **Visible** property of the object to `$True` to make the application visible. +method and set the **Visible** property of the object to `$true` to make the application visible. The second instance gets the same results with individual commands. ```powershell -$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $True} +$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $true} # The following command gets the same results as the example above. $IE2 = New-Object -COMObject InternetExplorer.Application` $IE2.Navigate2("www.microsoft.com")` -$IE2.Visible = $True` +$IE2.Visible = $true` ``` ### Example 3: Use the Strict parameter to generate a non-terminating error @@ -74,7 +74,7 @@ This example demonstrates that adding the **Strict** parameter causes the `New-O generate a non-terminating error when the COM object uses an interop assembly. ```powershell -$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $True} +$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $true} ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md index 9e8248bf084a..c347eabfdd91 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md @@ -79,7 +79,7 @@ they have the read-only attribute. ```powershell Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $Profile -Value (Get-Content alias.ps1) +Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) $S = New-PSSession -ComputerName Server01 Invoke-Command -Session $S -FilePath .\alias.ps1 ``` @@ -91,7 +91,7 @@ parameter with a value of Script to generate a file that contains a Set-Alias co alias. The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. -The path to the profile is saved in the `$Profile` variable. The command uses the `Get-Content` +The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md index bf32274af59b..531d8d496cdd 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -84,9 +84,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > array. This provides some obfuscation but does not provide encryption. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md index 732ab5645998..06f6c0be5fa4 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md @@ -48,7 +48,7 @@ default output cmdlet for display. These commands display information about the PS1XML files in the PowerShell directory as a list. ```powershell -$A = Get-ChildItem $pshome\*.ps1xml +$A = Get-ChildItem $PSHOME\*.ps1xml Format-List -InputObject $A ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Culture.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Culture.md index d8672e674633..9eebb66c986e 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Culture.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Culture.md @@ -243,8 +243,8 @@ This cmdlet returns a **CultureInfo** object representing the current culture. ## NOTES -You can also use the `$PsCulture` and `$PsUICulture` variables. The `$PsCulture` variable stores the -name of the current culture and the `$PsUICulture` variable stores the name of the current UI +You can also use the `$PSCulture` and `$PSUICulture` variables. The `$PSCulture` variable stores the +name of the current culture and the `$PSUICulture` variable stores the name of the current UI culture. ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-EventSubscriber.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-EventSubscriber.md index 092d0cb91163..90ba4e121230 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-EventSubscriber.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-EventSubscriber.md @@ -111,7 +111,7 @@ Id Name State HasMoreData Location Command ``` ```powershell -$Timer.Enabled = $True +$Timer.Enabled = $true $Subscriber = Get-EventSubscriber -SourceIdentifier Timer.Random ($Subscriber.action).gettype().fullname ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Member.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Member.md index a9018165e107..2e765a07ec68 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Member.md @@ -507,9 +507,9 @@ PowerShell includes the following aliases for `Get-Member`: You can get information about a collection object either using the **InputObject** parameter or by piping the object, preceded by a comma, to `Get-Member`. -You can use the `$This` automatic variable in script blocks that define the values of new properties -and methods. The `$This` variable refers to the instance of the object to which the properties and -methods are being added. For more information about the `$This` variable, see +You can use the `$this` automatic variable in script blocks that define the values of new properties +and methods. The `$this` variable refers to the instance of the object to which the properties and +methods are being added. For more information about the `$this` variable, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). If you pass an object representing a _type_, like a type literal such as `[int]`, `Get-Member` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md index 06fb6155fa84..bac85f0cede5 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -74,9 +74,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > such as macOS and Linux, credentials are exported in plain text. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-LocalizedData.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-LocalizedData.md index 021d28cc9fd5..d356a644fa39 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-LocalizedData.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-LocalizedData.md @@ -55,7 +55,7 @@ Import-LocalizedData -BindingVariable "Messages" ``` If the command is included in the Archives.ps1 script in the `C:\Test` directory, and the value of -the `$PsUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` +the `$PSUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` file in the `C:\test\zh-CN` directory into the `$Messages` variable. ### Example 2: Import localized data strings @@ -160,13 +160,13 @@ command that converts the contents of the DATA section to a hashtable and stores The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated text strings from the TestScript.psd1 file in the subdirectory specified by the value of the -`$PsUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from +`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the DATA section logic. The third command displays the first message in the `$UserMessages` variable. -If the `Import-LocalizedData` command finds a `.psd1` file for the `$PsUICulture` language, the +If the `Import-LocalizedData` command finds a `.psd1` file for the `$PSUICulture` language, the value of the `$UserMessages` variable contains the translated text strings. If the command fails for any reason, the command displays the default text strings defined in the DATA section of the script. @@ -301,14 +301,14 @@ Accept wildcard characters: False ### -UICulture -Specifies an alternate UI culture. The default is the value of the `$PsUICulture` automatic +Specifies an alternate UI culture. The default is the value of the `$PSUICulture` automatic variable. Enter a UI culture in `-` format, such as `en-US`, `de-DE`, or `ar-SA`. The value of the **UICulture** parameter determines the language-specific subdirectory (within the base directory) from which `Import-LocalizedData` gets the `.psd1` file for the script. The cmdlet searches for a subdirectory with the same name as the value of the **UICulture** -parameter or the `$PsUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the +parameter or the `$PSUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the directory, or the directory doesn't contain a `.psd1` file for the script, it searches for a subdirectory with the name of the language code, such as de or ar. If it can't find the subdirectory or `.psd1` file, the command fails and the data is displayed in the default language specified in @@ -363,7 +363,7 @@ parameter. `Import-LocalizedData` begins the search in the directory where the script file is located (or the value of the **BaseDirectory** parameter). It then searches within the base directory for a - subdirectory with the same name as the value of the `$PsUICulture` variable (or the value of the + subdirectory with the same name as the value of the `$PSUICulture` variable (or the value of the **UICulture** parameter), such as `de-DE` or `ar-SA`. Then, it searches in that subdirectory for a `.psd1` file with the same name as the script (or the value of the **FileName** parameter). diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-Expression.md b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-Expression.md index c3e26e2d8109..e599d0664a26 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-Expression.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-Expression.md @@ -145,12 +145,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.String -You can pipe a string representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe a string representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ### System.Management.Automation.PSObject -You can pipe an object representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe an object representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/New-Object.md b/reference/7.4/Microsoft.PowerShell.Utility/New-Object.md index ef6ee0ece399..79e682841ee4 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/New-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/New-Object.md @@ -56,16 +56,16 @@ Major Minor Build Revision This example creates two instances of the COM object that represents the Internet Explorer application. The first instance uses the **Property** parameter hash table to call the **Navigate2** -method and set the **Visible** property of the object to `$True` to make the application visible. +method and set the **Visible** property of the object to `$true` to make the application visible. The second instance gets the same results with individual commands. ```powershell -$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $True} +$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $true} # The following command gets the same results as the example above. $IE2 = New-Object -COMObject InternetExplorer.Application` $IE2.Navigate2("www.microsoft.com")` -$IE2.Visible = $True` +$IE2.Visible = $true` ``` ### Example 3: Use the Strict parameter to generate a non-terminating error @@ -74,7 +74,7 @@ This example demonstrates that adding the **Strict** parameter causes the `New-O generate a non-terminating error when the COM object uses an interop assembly. ```powershell -$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $True} +$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $true} ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md index e8ed896bc665..a868d8ecdd92 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md @@ -79,7 +79,7 @@ they have the read-only attribute. ```powershell Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $Profile -Value (Get-Content alias.ps1) +Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) $S = New-PSSession -ComputerName Server01 Invoke-Command -Session $S -FilePath .\alias.ps1 ``` @@ -91,7 +91,7 @@ parameter with a value of Script to generate a file that contains a Set-Alias co alias. The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. -The path to the profile is saved in the `$Profile` variable. The command uses the `Get-Content` +The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-Clixml.md index f534f14dc561..c45f7548e1d3 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -84,9 +84,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > array. This provides some obfuscation but does not provide encryption. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md index da1fff2ae34c..c4a4bfc0fcfb 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md @@ -49,7 +49,7 @@ default output cmdlet for display. These commands display information about the PS1XML files in the PowerShell directory as a list. ```powershell -$A = Get-ChildItem $pshome\*.ps1xml +$A = Get-ChildItem $PSHOME\*.ps1xml Format-List -InputObject $A ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Culture.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Culture.md index badb993c9411..b84646f23699 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Culture.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Culture.md @@ -243,8 +243,8 @@ This cmdlet returns a **CultureInfo** object representing the current culture. ## NOTES -You can also use the `$PsCulture` and `$PsUICulture` variables. The `$PsCulture` variable stores the -name of the current culture and the `$PsUICulture` variable stores the name of the current UI +You can also use the `$PSCulture` and `$PSUICulture` variables. The `$PSCulture` variable stores the +name of the current culture and the `$PSUICulture` variable stores the name of the current UI culture. ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-EventSubscriber.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-EventSubscriber.md index 59f3807fe7c5..d0f05c000e70 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-EventSubscriber.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-EventSubscriber.md @@ -116,7 +116,7 @@ Id Name State HasMoreData Location Command ``` ```powershell -$Timer.Enabled = $True +$Timer.Enabled = $true $Subscriber = Get-EventSubscriber -SourceIdentifier Timer.Random ($Subscriber.Action).GetType().FullName ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Member.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Member.md index 9fa44403f7b5..1664955a20a6 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Member.md @@ -507,9 +507,9 @@ PowerShell includes the following aliases for `Get-Member`: You can get information about a collection object either using the **InputObject** parameter or by piping the object, preceded by a comma, to `Get-Member`. -You can use the `$This` automatic variable in script blocks that define the values of new properties -and methods. The `$This` variable refers to the instance of the object to which the properties and -methods are being added. For more information about the `$This` variable, see +You can use the `$this` automatic variable in script blocks that define the values of new properties +and methods. The `$this` variable refers to the instance of the object to which the properties and +methods are being added. For more information about the `$this` variable, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). If you pass an object representing a _type_, like a type literal such as `[int]`, `Get-Member` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md index 4308f44b1280..a8cbb2aeb0a9 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -74,9 +74,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > such as macOS and Linux, credentials are exported in plain text. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-LocalizedData.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-LocalizedData.md index 201607cb6303..e5cbfb6b82c5 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-LocalizedData.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-LocalizedData.md @@ -55,7 +55,7 @@ Import-LocalizedData -BindingVariable "Messages" ``` If the command is included in the Archives.ps1 script in the `C:\Test` directory, and the value of -the `$PsUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` +the `$PSUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` file in the `C:\test\zh-CN` directory into the `$Messages` variable. ### Example 2: Import localized data strings @@ -160,13 +160,13 @@ command that converts the contents of the DATA section to a hashtable and stores The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated text strings from the TestScript.psd1 file in the subdirectory specified by the value of the -`$PsUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from +`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the DATA section logic. The third command displays the first message in the `$UserMessages` variable. -If the `Import-LocalizedData` command finds a `.psd1` file for the `$PsUICulture` language, the +If the `Import-LocalizedData` command finds a `.psd1` file for the `$PSUICulture` language, the value of the `$UserMessages` variable contains the translated text strings. If the command fails for any reason, the command displays the default text strings defined in the DATA section of the script. @@ -301,14 +301,14 @@ Accept wildcard characters: False ### -UICulture -Specifies an alternate UI culture. The default is the value of the `$PsUICulture` automatic +Specifies an alternate UI culture. The default is the value of the `$PSUICulture` automatic variable. Enter a UI culture in `-` format, such as `en-US`, `de-DE`, or `ar-SA`. The value of the **UICulture** parameter determines the language-specific subdirectory (within the base directory) from which `Import-LocalizedData` gets the `.psd1` file for the script. The cmdlet searches for a subdirectory with the same name as the value of the **UICulture** -parameter or the `$PsUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the +parameter or the `$PSUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the directory, or the directory doesn't contain a `.psd1` file for the script, it searches for a subdirectory with the name of the language code, such as de or ar. If it can't find the subdirectory or `.psd1` file, the command fails and the data is displayed in the default language specified in @@ -363,7 +363,7 @@ parameter. `Import-LocalizedData` begins the search in the directory where the script file is located (or the value of the **BaseDirectory** parameter). It then searches within the base directory for a - subdirectory with the same name as the value of the `$PsUICulture` variable (or the value of the + subdirectory with the same name as the value of the `$PSUICulture` variable (or the value of the **UICulture** parameter), such as `de-DE` or `ar-SA`. Then, it searches in that subdirectory for a `.psd1` file with the same name as the script (or the value of the **FileName** parameter). diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-Expression.md b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-Expression.md index 8ccd687cbabd..ea9bb76502d0 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-Expression.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-Expression.md @@ -145,12 +145,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.String -You can pipe a string representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe a string representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ### System.Management.Automation.PSObject -You can pipe an object representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe an object representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/New-Object.md b/reference/7.5/Microsoft.PowerShell.Utility/New-Object.md index cf8237de80c5..38257bf98c00 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/New-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/New-Object.md @@ -56,16 +56,16 @@ Major Minor Build Revision This example creates two instances of the COM object that represents the Internet Explorer application. The first instance uses the **Property** parameter hash table to call the **Navigate2** -method and set the **Visible** property of the object to `$True` to make the application visible. +method and set the **Visible** property of the object to `$true` to make the application visible. The second instance gets the same results with individual commands. ```powershell -$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $True} +$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $true} # The following command gets the same results as the example above. $IE2 = New-Object -COMObject InternetExplorer.Application` $IE2.Navigate2("www.microsoft.com")` -$IE2.Visible = $True` +$IE2.Visible = $true` ``` ### Example 3: Use the Strict parameter to generate a non-terminating error @@ -74,7 +74,7 @@ This example demonstrates that adding the **Strict** parameter causes the `New-O generate a non-terminating error when the COM object uses an interop assembly. ```powershell -$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $True} +$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $true} ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md index a2fb1a61a0cc..d8781b98e581 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md @@ -79,7 +79,7 @@ they have the read-only attribute. ```powershell Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $Profile -Value (Get-Content alias.ps1) +Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) $S = New-PSSession -ComputerName Server01 Invoke-Command -Session $S -FilePath .\alias.ps1 ``` @@ -91,7 +91,7 @@ parameter with a value of Script to generate a file that contains a Set-Alias co alias. The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. -The path to the profile is saved in the `$Profile` variable. The command uses the `Get-Content` +The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md index c7221e6c081d..60f9dc3e51c3 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -84,9 +84,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > array. This provides some obfuscation but does not provide encryption. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.6/Microsoft.PowerShell.Utility/Format-List.md index 4a7f4fa93798..666e4fbde956 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Format-List.md @@ -48,7 +48,7 @@ default output cmdlet for display. These commands display information about the PS1XML files in the PowerShell directory as a list. ```powershell -$A = Get-ChildItem $pshome\*.ps1xml +$A = Get-ChildItem $PSHOME\*.ps1xml Format-List -InputObject $A ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Culture.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Culture.md index 0f03e7d9c1fa..1f8c5b00bf59 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Culture.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Culture.md @@ -243,8 +243,8 @@ This cmdlet returns a **CultureInfo** object representing the current culture. ## NOTES -You can also use the `$PsCulture` and `$PsUICulture` variables. The `$PsCulture` variable stores the -name of the current culture and the `$PsUICulture` variable stores the name of the current UI +You can also use the `$PSCulture` and `$PSUICulture` variables. The `$PSCulture` variable stores the +name of the current culture and the `$PSUICulture` variable stores the name of the current UI culture. ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md index f0d259743643..f2eac9450c02 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md @@ -111,7 +111,7 @@ Id Name State HasMoreData Location Command ``` ```powershell -$Timer.Enabled = $True +$Timer.Enabled = $true $Subscriber = Get-EventSubscriber -SourceIdentifier Timer.Random ($Subscriber.action).GetType().fullname ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Member.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Member.md index bd5f436ee015..d44770c15155 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Member.md @@ -507,9 +507,9 @@ PowerShell includes the following aliases for `Get-Member`: You can get information about a collection object either using the **InputObject** parameter or by piping the object, preceded by a comma, to `Get-Member`. -You can use the `$This` automatic variable in script blocks that define the values of new properties -and methods. The `$This` variable refers to the instance of the object to which the properties and -methods are being added. For more information about the `$This` variable, see +You can use the `$this` automatic variable in script blocks that define the values of new properties +and methods. The `$this` variable refers to the instance of the object to which the properties and +methods are being added. For more information about the `$this` variable, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). If you pass an object representing a _type_, like a type literal such as `[int]`, `Get-Member` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md index 20e7cf228172..9fbb5e89fd00 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -74,9 +74,9 @@ In this example, given a credential that you've stored in the `$Credential` vari > such as macOS and Linux, credentials are exported in plain text. ```powershell -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential | Export-Clixml $Credxmlpath -$Credxmlpath = Join-Path (Split-Path $Profile) TestScript.ps1.credential +$Credxmlpath = Join-Path (Split-Path $PROFILE) TestScript.ps1.credential $Credential = Import-Clixml $Credxmlpath ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-LocalizedData.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-LocalizedData.md index d21b6e4cdf82..20760db630d7 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-LocalizedData.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-LocalizedData.md @@ -55,7 +55,7 @@ Import-LocalizedData -BindingVariable "Messages" ``` If the command is included in the Archives.ps1 script in the `C:\Test` directory, and the value of -the `$PsUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` +the `$PSUICulture` automatic variable is zh-CN, `Import-LocalizedData` imports the `Archives.psd1` file in the `C:\test\zh-CN` directory into the `$Messages` variable. ### Example 2: Import localized data strings @@ -160,13 +160,13 @@ command that converts the contents of the DATA section to a hashtable and stores The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated text strings from the TestScript.psd1 file in the subdirectory specified by the value of the -`$PsUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from +`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the DATA section logic. The third command displays the first message in the `$UserMessages` variable. -If the `Import-LocalizedData` command finds a `.psd1` file for the `$PsUICulture` language, the +If the `Import-LocalizedData` command finds a `.psd1` file for the `$PSUICulture` language, the value of the `$UserMessages` variable contains the translated text strings. If the command fails for any reason, the command displays the default text strings defined in the DATA section of the script. @@ -301,14 +301,14 @@ Accept wildcard characters: False ### -UICulture -Specifies an alternate UI culture. The default is the value of the `$PsUICulture` automatic +Specifies an alternate UI culture. The default is the value of the `$PSUICulture` automatic variable. Enter a UI culture in `-` format, such as `en-US`, `de-DE`, or `ar-SA`. The value of the **UICulture** parameter determines the language-specific subdirectory (within the base directory) from which `Import-LocalizedData` gets the `.psd1` file for the script. The cmdlet searches for a subdirectory with the same name as the value of the **UICulture** -parameter or the `$PsUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the +parameter or the `$PSUICulture` automatic variable, such as `de-DE` or `ar-SA`. If it can't find the directory, or the directory doesn't contain a `.psd1` file for the script, it searches for a subdirectory with the name of the language code, such as de or ar. If it can't find the subdirectory or `.psd1` file, the command fails and the data is displayed in the default language specified in @@ -363,7 +363,7 @@ parameter. `Import-LocalizedData` begins the search in the directory where the script file is located (or the value of the **BaseDirectory** parameter). It then searches within the base directory for a - subdirectory with the same name as the value of the `$PsUICulture` variable (or the value of the + subdirectory with the same name as the value of the `$PSUICulture` variable (or the value of the **UICulture** parameter), such as `de-DE` or `ar-SA`. Then, it searches in that subdirectory for a `.psd1` file with the same name as the script (or the value of the **FileName** parameter). diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-Expression.md b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-Expression.md index adc991f2efd2..26e43383f97c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-Expression.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-Expression.md @@ -145,12 +145,12 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.String -You can pipe a string representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe a string representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ### System.Management.Automation.PSObject -You can pipe an object representing the expression to invoke to this cmdlet. Use the `$Input` +You can pipe an object representing the expression to invoke to this cmdlet. Use the `$input` automatic variable to represent the input objects in the command. ## OUTPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/New-Object.md b/reference/7.6/Microsoft.PowerShell.Utility/New-Object.md index 1d815c6ee266..2a5fdb56d4a6 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/New-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/New-Object.md @@ -56,16 +56,16 @@ Major Minor Build Revision This example creates two instances of the COM object that represents the Internet Explorer application. The first instance uses the **Property** parameter hash table to call the **Navigate2** -method and set the **Visible** property of the object to `$True` to make the application visible. +method and set the **Visible** property of the object to `$true` to make the application visible. The second instance gets the same results with individual commands. ```powershell -$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $True} +$IE1 = New-Object -COMObject InternetExplorer.Application -Property @{Navigate2="www.microsoft.com"; Visible = $true} # The following command gets the same results as the example above. $IE2 = New-Object -COMObject InternetExplorer.Application` $IE2.Navigate2("www.microsoft.com")` -$IE2.Visible = $True` +$IE2.Visible = $true` ``` ### Example 3: Use the Strict parameter to generate a non-terminating error @@ -74,7 +74,7 @@ This example demonstrates that adding the **Strict** parameter causes the `New-O generate a non-terminating error when the COM object uses an interop assembly. ```powershell -$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $True} +$A = New-Object -COMObject Word.Application -Strict -Property @{Visible = $true} ``` ```Output From bff8b2c3d7287c0481a12a81cd56bf339eb93ab0 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:48:28 +0000 Subject: [PATCH 14/16] Fix automatic variable case (#11836) --- reference/5.1/Microsoft.PowerShell.Utility/Out-File.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- .../Microsoft.PowerShell.Utility/Register-ObjectEvent.md | 4 ++-- reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md | 6 +++--- reference/5.1/Microsoft.PowerShell.Utility/Show-Command.md | 2 +- reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md | 2 +- reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md | 4 ++-- .../5.1/Microsoft.PowerShell.Utility/Update-TypeData.md | 6 +++--- reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md | 2 +- .../5.1/Microsoft.WSMan.Management/Enable-WSManCredSSP.md | 2 +- reference/7.4/Microsoft.PowerShell.Utility/Out-File.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- .../Microsoft.PowerShell.Utility/Register-ObjectEvent.md | 4 ++-- reference/7.4/Microsoft.PowerShell.Utility/Select-Xml.md | 6 +++--- reference/7.4/Microsoft.PowerShell.Utility/Show-Command.md | 2 +- reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md | 2 +- reference/7.4/Microsoft.PowerShell.Utility/Trace-Command.md | 4 ++-- .../7.4/Microsoft.PowerShell.Utility/Update-TypeData.md | 6 +++--- reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md | 2 +- .../7.4/Microsoft.WSMan.Management/Enable-WSManCredSSP.md | 2 +- reference/7.5/Microsoft.PowerShell.Utility/Out-File.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- .../Microsoft.PowerShell.Utility/Register-ObjectEvent.md | 4 ++-- reference/7.5/Microsoft.PowerShell.Utility/Select-Xml.md | 6 +++--- reference/7.5/Microsoft.PowerShell.Utility/Show-Command.md | 2 +- reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md | 2 +- reference/7.5/Microsoft.PowerShell.Utility/Trace-Command.md | 4 ++-- .../7.5/Microsoft.PowerShell.Utility/Update-TypeData.md | 6 +++--- reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md | 2 +- .../7.5/Microsoft.WSMan.Management/Enable-WSManCredSSP.md | 2 +- reference/7.6/Microsoft.PowerShell.Utility/Out-File.md | 2 +- .../Microsoft.PowerShell.Utility/Register-EngineEvent.md | 2 +- .../Microsoft.PowerShell.Utility/Register-ObjectEvent.md | 4 ++-- reference/7.6/Microsoft.PowerShell.Utility/Select-Xml.md | 6 +++--- reference/7.6/Microsoft.PowerShell.Utility/Show-Command.md | 2 +- reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md | 2 +- reference/7.6/Microsoft.PowerShell.Utility/Trace-Command.md | 4 ++-- .../7.6/Microsoft.PowerShell.Utility/Update-TypeData.md | 6 +++--- reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md | 2 +- .../7.6/Microsoft.WSMan.Management/Enable-WSManCredSSP.md | 2 +- 40 files changed, 64 insertions(+), 64 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md b/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md index 5d26b9d096ba..d51cae08b997 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md @@ -147,7 +147,7 @@ function DemoDefaultOutFileWidth() { try { $PSDefaultParameterValues['out-file:width'] = 2000 - $logFile = "$pwd\logfile.txt" + $logFile = "$PWD\logfile.txt" Get-ChildItem Env:\ > $logFile diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 27115530b31c..d055b308e0d6 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -85,7 +85,7 @@ Register-EngineEvent -SourceIdentifier MyEventSource -Action { } Start-Job -Name TestJob -ScriptBlock { - While ($True) { + While ($true) { Register-EngineEvent -SourceIdentifier MyEventSource -Forward Start-Sleep -seconds 2 "Doing some work..." diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index 339cad448564..ab3b93da38ce 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -106,7 +106,7 @@ function Enable-ProcessCreationEvent { EventName = 'EventArrived' SourceIdentifier = 'WMI.ProcessCreated' MessageData = 'Test' - Forward = $True + Forward = $true } Register-ObjectEvent @objectEventArgs } @@ -141,7 +141,7 @@ variable. ```powershell $Timer = New-Object Timers.Timer $Timer.Interval = 500 -$Timer.Enabled = $True +$Timer.Enabled = $true $objectEventArgs = @{ InputObject = $Timer EventName = 'Elapsed' diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md index d3584459e6d0..eeeec2885ccc 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md @@ -61,7 +61,7 @@ the XPath statement from the `Types.ps1xml` file. The command uses a pipeline op **Node** object and returns its **Name** and **ReferencedMemberName** properties. ```powershell -$Path = "$Pshome\Types.ps1xml" +$Path = "$PSHOME\Types.ps1xml" $XPath = "/Types/Type/Members/AliasProperty" Select-Xml -Path $Path -XPath $Xpath | Select-Object -ExpandProperty Node ``` @@ -103,7 +103,7 @@ the **Xml** parameter to specify the XML content in the `$Types` variable and th parameter to specify the path to the **MethodName** node. ```powershell -[xml]$Types = Get-Content $Pshome\Types.ps1xml +[xml]$Types = Get-Content $PSHOME\Types.ps1xml Select-Xml -Xml $Types -XPath "//MethodName" ``` @@ -138,7 +138,7 @@ $Namespace = @{ dev = "http://schemas.microsoft.com/maml/dev/2004/10" } -$Path = "$Pshome\en-us\*dll-Help.xml" +$Path = "$PSHOME\en-us\*dll-Help.xml" $Xml = Select-Xml -Path $Path -Namespace $Namespace -XPath "//command:name" $Xml | Format-Table @{Label="Name"; Expression= {($_.node.innerxml).trim()}}, Path -AutoSize ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Show-Command.md b/reference/5.1/Microsoft.PowerShell.Utility/Show-Command.md index a5151e8faebe..2daac3591c2a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Show-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Show-Command.md @@ -95,7 +95,7 @@ the **Height**, **Width**, and **ErrorPopup** parameters of the `Show-Command` c $PSDefaultParameterValues = @{ "Show-Command:Height" = 700 "Show-Command:Width" = 1000 - "Show-Command:ErrorPopup" = $True + "Show-Command:ErrorPopup" = $true } ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md index 4624edb0a90a..98bb1459663f 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Sort-Object.md @@ -190,7 +190,7 @@ hash table to specify the property names and sort orders. The **Property** param two properties, **Status** in descending order and **DisplayName** in ascending order. **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value -of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed +of **4**. The **Descending** parameter is set to `$true` so that **Running** processes are displayed before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md index 5e8f2dc62e25..7cf54af8e81c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md @@ -61,7 +61,7 @@ processes a `Get-Alias` expression that takes input from the pipeline. ```powershell $A = "i*" -Trace-Command ParameterBinding {Get-Alias $Input} -PSHost -InputObject $A +Trace-Command ParameterBinding {Get-Alias $input} -PSHost -InputObject $A ``` In `Trace-Command`, the **InputObject** parameter passes an object to the expression that's being @@ -71,7 +71,7 @@ The first command stores the string `i*` in the `$A` variable. The second comman `Trace-Command` cmdlet with the ParameterBinding trace source. The **PSHost** parameter sends the output to the console. -The expression being processed is `Get-Alias $Input`, where the `$Input` variable is associated with +The expression being processed is `Get-Alias $input`, where the `$input` variable is associated with the **InputObject** parameter. The **InputObject** parameter passes the variable `$A` to the expression. In effect, the command being processed during the trace is `Get-Alias -InputObject $A" or "$A | Get-Alias`. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md index 36c64789ee6a..77110bf71fe6 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -492,11 +492,11 @@ Accept wildcard characters: False ### -InheritPropertySerializationSet Indicates whether the set of properties that are serialized is inherited. The default value is -`$Null`. The acceptable values for this parameter are: +`$null`. The acceptable values for this parameter are: -- `$True`. The property set is inherited. +- `$true`. The property set is inherited. - `$false`. The property set is not inherited. -- `$Null`. Inheritance is not defined. +- `$null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is `SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md index 13a7284d1fe0..5a779e121df2 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Wait-Event.md @@ -63,7 +63,7 @@ $objectEventArgs = @{ Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 $Timer.Autoreset = $false -$Timer.Enabled = $True +$Timer.Enabled = $true Wait-Event Timer.Elapsed ``` diff --git a/reference/5.1/Microsoft.WSMan.Management/Enable-WSManCredSSP.md b/reference/5.1/Microsoft.WSMan.Management/Enable-WSManCredSSP.md index a6d3c862d85e..2e58689a3a2c 100644 --- a/reference/5.1/Microsoft.WSMan.Management/Enable-WSManCredSSP.md +++ b/reference/5.1/Microsoft.WSMan.Management/Enable-WSManCredSSP.md @@ -133,7 +133,7 @@ the WSMan provider must be set to true. ```powershell Connect-WSMan -ComputerName "server02" -Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $True +Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $true ``` `Connect-WSMan` creates a connection to the remote computer, server02. `Set-Item` uses the **Path** diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Out-File.md b/reference/7.4/Microsoft.PowerShell.Utility/Out-File.md index 6d32c6102398..03d43c9099ca 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Out-File.md @@ -150,7 +150,7 @@ function DemoDefaultOutFileWidth() { try { $PSDefaultParameterValues['out-file:width'] = 2000 - $logFile = "$pwd\logfile.txt" + $logFile = "$PWD\logfile.txt" Get-ChildItem Env:\ > $logFile diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md index b5494d928904..634c2acf0ec9 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -85,7 +85,7 @@ Register-EngineEvent -SourceIdentifier MyEventSource -Action { } Start-Job -Name TestJob -ScriptBlock { - While ($True) { + While ($true) { Register-EngineEvent -SourceIdentifier MyEventSource -Forward Start-Sleep -seconds 2 "Doing some work..." diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index 6a85dec22c18..c9d1675e71e2 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -106,7 +106,7 @@ function Enable-ProcessCreationEvent { EventName = 'EventArrived' SourceIdentifier = 'WMI.ProcessCreated' MessageData = 'Test' - Forward = $True + Forward = $true } Register-ObjectEvent @objectEventArgs } @@ -141,7 +141,7 @@ variable. ```powershell $Timer = New-Object Timers.Timer $Timer.Interval = 500 -$Timer.Enabled = $True +$Timer.Enabled = $true $objectEventArgs = @{ InputObject = $Timer EventName = 'Elapsed' diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/7.4/Microsoft.PowerShell.Utility/Select-Xml.md index 41a20d0a9b4d..34a1fc377fb7 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Select-Xml.md @@ -61,7 +61,7 @@ the XPath statement from the `Types.ps1xml` file. The command uses a pipeline op **Node** object and returns its **Name** and **ReferencedMemberName** properties. ```powershell -$Path = "$Pshome\Types.ps1xml" +$Path = "$PSHOME\Types.ps1xml" $XPath = "/Types/Type/Members/AliasProperty" Select-Xml -Path $Path -XPath $Xpath | Select-Object -ExpandProperty Node ``` @@ -103,7 +103,7 @@ the **Xml** parameter to specify the XML content in the `$Types` variable and th parameter to specify the path to the **MethodName** node. ```powershell -[xml]$Types = Get-Content $Pshome\Types.ps1xml +[xml]$Types = Get-Content $PSHOME\Types.ps1xml Select-Xml -Xml $Types -XPath "//MethodName" ``` @@ -138,7 +138,7 @@ $Namespace = @{ dev = "http://schemas.microsoft.com/maml/dev/2004/10" } -$Path = "$Pshome\en-us\*dll-Help.xml" +$Path = "$PSHOME\en-us\*dll-Help.xml" $Xml = Select-Xml -Path $Path -Namespace $Namespace -XPath "//command:name" $Xml | Format-Table @{Label="Name"; Expression= {($_.node.innerxml).trim()}}, Path -AutoSize ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Show-Command.md b/reference/7.4/Microsoft.PowerShell.Utility/Show-Command.md index c30a5d859ad5..161fd91d439b 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Show-Command.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Show-Command.md @@ -97,7 +97,7 @@ the **Height**, **Width**, and **ErrorPopup** parameters of the `Show-Command` c $PSDefaultParameterValues = @{ "Show-Command:Height" = 700 "Show-Command:Width" = 1000 - "Show-Command:ErrorPopup" = $True + "Show-Command:ErrorPopup" = $true } ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md index 15df9648e1b6..b9233f485669 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Sort-Object.md @@ -208,7 +208,7 @@ hash table to specify the property names and sort orders. The **Property** param two properties, **Status** in descending order and **DisplayName** in ascending order. **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value -of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed +of **4**. The **Descending** parameter is set to `$true` so that **Running** processes are displayed before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/7.4/Microsoft.PowerShell.Utility/Trace-Command.md index d3bdf64a8a08..0a707cc3ecd3 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Trace-Command.md @@ -61,7 +61,7 @@ processes a `Get-Alias` expression that takes input from the pipeline. ```powershell $A = "i*" -Trace-Command ParameterBinding {Get-Alias $Input} -PSHost -InputObject $A +Trace-Command ParameterBinding {Get-Alias $input} -PSHost -InputObject $A ``` In `Trace-Command`, the **InputObject** parameter passes an object to the expression that's being @@ -71,7 +71,7 @@ The first command stores the string `i*` in the `$A` variable. The second comman `Trace-Command` cmdlet with the ParameterBinding trace source. The **PSHost** parameter sends the output to the console. -The expression being processed is `Get-Alias $Input`, where the `$Input` variable is associated with +The expression being processed is `Get-Alias $input`, where the `$input` variable is associated with the **InputObject** parameter. The **InputObject** parameter passes the variable `$A` to the expression. In effect, the command being processed during the trace is `Get-Alias -InputObject $A" or "$A | Get-Alias`. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md index bc187937810a..0c2308ce94d2 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -500,11 +500,11 @@ Accept wildcard characters: False ### -InheritPropertySerializationSet Indicates whether the set of properties that are serialized is inherited. The default value is -`$Null`. The acceptable values for this parameter are: +`$null`. The acceptable values for this parameter are: -- `$True`. The property set is inherited. +- `$true`. The property set is inherited. - `$false`. The property set is not inherited. -- `$Null`. Inheritance is not defined. +- `$null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is `SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md index 3a13c94b6e7f..5027020f1bf2 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Wait-Event.md @@ -63,7 +63,7 @@ $objectEventArgs = @{ Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 $Timer.Autoreset = $false -$Timer.Enabled = $True +$Timer.Enabled = $true Wait-Event Timer.Elapsed ``` diff --git a/reference/7.4/Microsoft.WSMan.Management/Enable-WSManCredSSP.md b/reference/7.4/Microsoft.WSMan.Management/Enable-WSManCredSSP.md index d27246738703..50dc123dfe1c 100644 --- a/reference/7.4/Microsoft.WSMan.Management/Enable-WSManCredSSP.md +++ b/reference/7.4/Microsoft.WSMan.Management/Enable-WSManCredSSP.md @@ -135,7 +135,7 @@ the WSMan provider must be set to true. ```powershell Connect-WSMan -ComputerName "server02" -Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $True +Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $true ``` `Connect-WSMan` creates a connection to the remote computer, server02. `Set-Item` uses the **Path** diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Out-File.md b/reference/7.5/Microsoft.PowerShell.Utility/Out-File.md index 982484549617..723a8e299566 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Out-File.md @@ -150,7 +150,7 @@ function DemoDefaultOutFileWidth() { try { $PSDefaultParameterValues['out-file:width'] = 2000 - $logFile = "$pwd\logfile.txt" + $logFile = "$PWD\logfile.txt" Get-ChildItem Env:\ > $logFile diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md index de8cb7653af1..7678c40df3df 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -85,7 +85,7 @@ Register-EngineEvent -SourceIdentifier MyEventSource -Action { } Start-Job -Name TestJob -ScriptBlock { - While ($True) { + While ($true) { Register-EngineEvent -SourceIdentifier MyEventSource -Forward Start-Sleep -seconds 2 "Doing some work..." diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index f8ff8d90659c..957c468bbc79 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -106,7 +106,7 @@ function Enable-ProcessCreationEvent { EventName = 'EventArrived' SourceIdentifier = 'WMI.ProcessCreated' MessageData = 'Test' - Forward = $True + Forward = $true } Register-ObjectEvent @objectEventArgs } @@ -141,7 +141,7 @@ variable. ```powershell $Timer = New-Object Timers.Timer $Timer.Interval = 500 -$Timer.Enabled = $True +$Timer.Enabled = $true $objectEventArgs = @{ InputObject = $Timer EventName = 'Elapsed' diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/7.5/Microsoft.PowerShell.Utility/Select-Xml.md index a9b97e5ee751..a441f062bdfe 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Select-Xml.md @@ -61,7 +61,7 @@ the XPath statement from the `Types.ps1xml` file. The command uses a pipeline op **Node** object and returns its **Name** and **ReferencedMemberName** properties. ```powershell -$Path = "$Pshome\Types.ps1xml" +$Path = "$PSHOME\Types.ps1xml" $XPath = "/Types/Type/Members/AliasProperty" Select-Xml -Path $Path -XPath $Xpath | Select-Object -ExpandProperty Node ``` @@ -103,7 +103,7 @@ the **Xml** parameter to specify the XML content in the `$Types` variable and th parameter to specify the path to the **MethodName** node. ```powershell -[xml]$Types = Get-Content $Pshome\Types.ps1xml +[xml]$Types = Get-Content $PSHOME\Types.ps1xml Select-Xml -Xml $Types -XPath "//MethodName" ``` @@ -138,7 +138,7 @@ $Namespace = @{ dev = "http://schemas.microsoft.com/maml/dev/2004/10" } -$Path = "$Pshome\en-us\*dll-Help.xml" +$Path = "$PSHOME\en-us\*dll-Help.xml" $Xml = Select-Xml -Path $Path -Namespace $Namespace -XPath "//command:name" $Xml | Format-Table @{Label="Name"; Expression= {($_.Node.InnerXml).trim()}}, Path -AutoSize ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Show-Command.md b/reference/7.5/Microsoft.PowerShell.Utility/Show-Command.md index 29609e3d1144..02750da6f88a 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Show-Command.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Show-Command.md @@ -97,7 +97,7 @@ the **Height**, **Width**, and **ErrorPopup** parameters of the `Show-Command` c $PSDefaultParameterValues = @{ "Show-Command:Height" = 700 "Show-Command:Width" = 1000 - "Show-Command:ErrorPopup" = $True + "Show-Command:ErrorPopup" = $true } ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md index 6f13d7c46b23..55636d4976b4 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Sort-Object.md @@ -208,7 +208,7 @@ hash table to specify the property names and sort orders. The **Property** param two properties, **Status** in descending order and **DisplayName** in ascending order. **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value -of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed +of **4**. The **Descending** parameter is set to `$true` so that **Running** processes are displayed before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/7.5/Microsoft.PowerShell.Utility/Trace-Command.md index 46e3940552f4..651377f550ec 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Trace-Command.md @@ -61,7 +61,7 @@ processes a `Get-Alias` expression that takes input from the pipeline. ```powershell $A = "i*" -Trace-Command ParameterBinding {Get-Alias $Input} -PSHost -InputObject $A +Trace-Command ParameterBinding {Get-Alias $input} -PSHost -InputObject $A ``` In `Trace-Command`, the **InputObject** parameter passes an object to the expression that's being @@ -71,7 +71,7 @@ The first command stores the string `i*` in the `$A` variable. The second comman `Trace-Command` cmdlet with the ParameterBinding trace source. The **PSHost** parameter sends the output to the console. -The expression being processed is `Get-Alias $Input`, where the `$Input` variable is associated with +The expression being processed is `Get-Alias $input`, where the `$input` variable is associated with the **InputObject** parameter. The **InputObject** parameter passes the variable `$A` to the expression. In effect, the command being processed during the trace is `Get-Alias -InputObject $A" or "$A | Get-Alias`. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md index 289121810f4d..3dedb8383674 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -500,11 +500,11 @@ Accept wildcard characters: False ### -InheritPropertySerializationSet Indicates whether the set of properties that are serialized is inherited. The default value is -`$Null`. The acceptable values for this parameter are: +`$null`. The acceptable values for this parameter are: -- `$True`. The property set is inherited. +- `$true`. The property set is inherited. - `$false`. The property set is not inherited. -- `$Null`. Inheritance is not defined. +- `$null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is `SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md index 2ef50d33707a..45890cebbda1 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Wait-Event.md @@ -63,7 +63,7 @@ $objectEventArgs = @{ Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 $Timer.AutoReset = $false -$Timer.Enabled = $True +$Timer.Enabled = $true Wait-Event Timer.Elapsed ``` diff --git a/reference/7.5/Microsoft.WSMan.Management/Enable-WSManCredSSP.md b/reference/7.5/Microsoft.WSMan.Management/Enable-WSManCredSSP.md index cfb0d1d743f3..c52c646b3fd2 100644 --- a/reference/7.5/Microsoft.WSMan.Management/Enable-WSManCredSSP.md +++ b/reference/7.5/Microsoft.WSMan.Management/Enable-WSManCredSSP.md @@ -135,7 +135,7 @@ the WSMan provider must be set to true. ```powershell Connect-WSMan -ComputerName "server02" -Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $True +Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $true ``` `Connect-WSMan` creates a connection to the remote computer, server02. `Set-Item` uses the **Path** diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Out-File.md b/reference/7.6/Microsoft.PowerShell.Utility/Out-File.md index 462e4c33aba3..ed074cb23309 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Out-File.md @@ -150,7 +150,7 @@ function DemoDefaultOutFileWidth() { try { $PSDefaultParameterValues['out-file:width'] = 2000 - $logFile = "$pwd\logfile.txt" + $logFile = "$PWD\logfile.txt" Get-ChildItem Env:\ > $logFile diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md index a496520bc10c..02b46da862b3 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -85,7 +85,7 @@ Register-EngineEvent -SourceIdentifier MyEventSource -Action { } Start-Job -Name TestJob -ScriptBlock { - While ($True) { + While ($true) { Register-EngineEvent -SourceIdentifier MyEventSource -Forward Start-Sleep -seconds 2 "Doing some work..." diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md b/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md index 32ef5d7725a5..0890fba88cb7 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Register-ObjectEvent.md @@ -106,7 +106,7 @@ function Enable-ProcessCreationEvent { EventName = 'EventArrived' SourceIdentifier = 'WMI.ProcessCreated' MessageData = 'Test' - Forward = $True + Forward = $true } Register-ObjectEvent @objectEventArgs } @@ -141,7 +141,7 @@ variable. ```powershell $Timer = New-Object Timers.Timer $Timer.Interval = 500 -$Timer.Enabled = $True +$Timer.Enabled = $true $objectEventArgs = @{ InputObject = $Timer EventName = 'Elapsed' diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/7.6/Microsoft.PowerShell.Utility/Select-Xml.md index 8082dd1a318a..100e6a06e499 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Select-Xml.md @@ -61,7 +61,7 @@ the XPath statement from the `Types.ps1xml` file. The command uses a pipeline op **Node** object and returns its **Name** and **ReferencedMemberName** properties. ```powershell -$Path = "$Pshome\Types.ps1xml" +$Path = "$PSHOME\Types.ps1xml" $XPath = "/Types/Type/Members/AliasProperty" Select-Xml -Path $Path -XPath $Xpath | Select-Object -ExpandProperty Node ``` @@ -103,7 +103,7 @@ the **Xml** parameter to specify the XML content in the `$Types` variable and th parameter to specify the path to the **MethodName** node. ```powershell -[xml]$Types = Get-Content $Pshome\Types.ps1xml +[xml]$Types = Get-Content $PSHOME\Types.ps1xml Select-Xml -Xml $Types -XPath "//MethodName" ``` @@ -138,7 +138,7 @@ $Namespace = @{ dev = "http://schemas.microsoft.com/maml/dev/2004/10" } -$Path = "$Pshome\en-us\*dll-Help.xml" +$Path = "$PSHOME\en-us\*dll-Help.xml" $Xml = Select-Xml -Path $Path -Namespace $Namespace -XPath "//command:name" $Xml | Format-Table @{Label="Name"; Expression= {($_.Node.InnerXml).trim()}}, Path -AutoSize ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Show-Command.md b/reference/7.6/Microsoft.PowerShell.Utility/Show-Command.md index 2ca0e946672f..e4cddabb70b9 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Show-Command.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Show-Command.md @@ -97,7 +97,7 @@ the **Height**, **Width**, and **ErrorPopup** parameters of the `Show-Command` c $PSDefaultParameterValues = @{ "Show-Command:Height" = 700 "Show-Command:Width" = 1000 - "Show-Command:ErrorPopup" = $True + "Show-Command:ErrorPopup" = $true } ``` diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md index e81be4d554f8..05ed1fadb42b 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Sort-Object.md @@ -208,7 +208,7 @@ hash table to specify the property names and sort orders. The **Property** param two properties, **Status** in descending order and **DisplayName** in ascending order. **Status** is an enumerated property. **Stopped** has a value of **1** and **Running** has a value -of **4**. The **Descending** parameter is set to `$True` so that **Running** processes are displayed +of **4**. The **Descending** parameter is set to `$true` so that **Running** processes are displayed before **Stopped** processes. **DisplayName** sets the **Descending** parameter to `$false` to sort the display names in alphabetical order. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/7.6/Microsoft.PowerShell.Utility/Trace-Command.md index a30e5fc18655..bc45479b680d 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Trace-Command.md @@ -61,7 +61,7 @@ processes a `Get-Alias` expression that takes input from the pipeline. ```powershell $A = "i*" -Trace-Command ParameterBinding {Get-Alias $Input} -PSHost -InputObject $A +Trace-Command ParameterBinding {Get-Alias $input} -PSHost -InputObject $A ``` In `Trace-Command`, the **InputObject** parameter passes an object to the expression that's being @@ -71,7 +71,7 @@ The first command stores the string `i*` in the `$A` variable. The second comman `Trace-Command` cmdlet with the ParameterBinding trace source. The **PSHost** parameter sends the output to the console. -The expression being processed is `Get-Alias $Input`, where the `$Input` variable is associated with +The expression being processed is `Get-Alias $input`, where the `$input` variable is associated with the **InputObject** parameter. The **InputObject** parameter passes the variable `$A` to the expression. In effect, the command being processed during the trace is `Get-Alias -InputObject $A" or "$A | Get-Alias`. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md index a72c4a34f20c..e74d52860bb6 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -500,11 +500,11 @@ Accept wildcard characters: False ### -InheritPropertySerializationSet Indicates whether the set of properties that are serialized is inherited. The default value is -`$Null`. The acceptable values for this parameter are: +`$null`. The acceptable values for this parameter are: -- `$True`. The property set is inherited. +- `$true`. The property set is inherited. - `$false`. The property set is not inherited. -- `$Null`. Inheritance is not defined. +- `$null`. Inheritance is not defined. This parameter is valid only when the value of the **SerializationMethod** parameter is `SpecificProperties`. When the value of this parameter is `$false`, the **PropertySerializationSet** diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md index ffb3dce86fa2..12c8b208bd36 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Wait-Event.md @@ -63,7 +63,7 @@ $objectEventArgs = @{ Register-ObjectEvent @objectEventArgs $Timer.Interval = 2000 $Timer.AutoReset = $false -$Timer.Enabled = $True +$Timer.Enabled = $true Wait-Event Timer.Elapsed ``` diff --git a/reference/7.6/Microsoft.WSMan.Management/Enable-WSManCredSSP.md b/reference/7.6/Microsoft.WSMan.Management/Enable-WSManCredSSP.md index 630bba45b865..adfdd94f664d 100644 --- a/reference/7.6/Microsoft.WSMan.Management/Enable-WSManCredSSP.md +++ b/reference/7.6/Microsoft.WSMan.Management/Enable-WSManCredSSP.md @@ -135,7 +135,7 @@ the WSMan provider must be set to true. ```powershell Connect-WSMan -ComputerName "server02" -Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $True +Set-Item -Path "WSMan:\server02\service\auth\credSSP" -Value $true ``` `Connect-WSMan` creates a connection to the remote computer, server02. `Set-Item` uses the **Path** From 744ca8ef393866338d300f6c24f85c3c402843e6 Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:49:32 +0000 Subject: [PATCH 15/16] Fix automatic variable case (#11837) --- reference/5.1/ISE/Get-IseSnippet.md | 8 ++++---- reference/5.1/ISE/Import-IseSnippet.md | 2 +- reference/5.1/ISE/New-IseSnippet.md | 2 +- .../About/about_Eventlogs.md | 2 +- .../About/about_Format.ps1xml.md | 4 ++-- .../About/about_Preference_Variables.md | 12 +++++------ .../Export-Console.md | 4 ++-- .../Test-ComputerSecureChannel.md | 4 ++-- .../Microsoft.PowerShell.Utility/Get-Host.md | 2 +- .../Invoke-RestMethod.md | 2 +- .../Update-FormatData.md | 2 +- .../5.1/PSDiagnostics/Set-LogProperties.md | 2 +- .../5.1/PSReadLine/About/about_PSReadLine.md | 2 +- .../5.1/PSReadLine/Set-PSReadLineOption.md | 2 +- .../5.1/PSScheduledJob/Disable-JobTrigger.md | 2 +- .../PSScheduledJob/Get-ScheduledJobOption.md | 2 +- .../PSScheduledJob/New-ScheduledJobOption.md | 2 +- .../PSScheduledJob/Register-ScheduledJob.md | 2 +- .../5.1/PSScheduledJob/Set-ScheduledJob.md | 2 +- .../PSScheduledJob/Set-ScheduledJobOption.md | 4 ++-- .../About/about_ActivityCommonParameters.md | 20 +++++++++---------- .../About/about_WorkflowCommonParameters.md | 2 +- .../5.1/PSWorkflow/About/about_Workflows.md | 2 +- .../7.4/PSDiagnostics/Set-LogProperties.md | 2 +- .../7.4/PSReadLine/About/about_PSReadLine.md | 2 +- .../7.4/PSReadLine/Set-PSReadLineOption.md | 2 +- reference/7.4/ThreadJob/Start-ThreadJob.md | 2 +- .../7.5/PSDiagnostics/Set-LogProperties.md | 2 +- .../7.5/PSReadLine/About/about_PSReadLine.md | 2 +- .../7.5/PSReadLine/Set-PSReadLineOption.md | 2 +- reference/7.5/ThreadJob/Start-ThreadJob.md | 2 +- .../7.6/PSDiagnostics/Set-LogProperties.md | 2 +- .../7.6/PSReadLine/About/about_PSReadLine.md | 2 +- .../7.6/PSReadLine/Set-PSReadLineOption.md | 2 +- reference/7.6/ThreadJob/Start-ThreadJob.md | 2 +- 35 files changed, 56 insertions(+), 56 deletions(-) diff --git a/reference/5.1/ISE/Get-IseSnippet.md b/reference/5.1/ISE/Get-IseSnippet.md index e350820c459b..e86da9673ef9 100644 --- a/reference/5.1/ISE/Get-IseSnippet.md +++ b/reference/5.1/ISE/Get-IseSnippet.md @@ -100,14 +100,14 @@ This example displays the title and description of all snippets in the session, snippets, user-defined snippets, and imported snippets. ```powershell -$PSISE.CurrentPowerShellTab.Snippets | Format-Table DisplayTitle, Description +$psISE.CurrentPowerShellTab.Snippets | Format-Table DisplayTitle, Description ``` -The `$PSISE` variable represents the Windows PowerShell ISE host program. The -**CurrentPowerShellTab** property of the `$PSISE` variable represent the current session. The +The `$psISE` variable represents the Windows PowerShell ISE host program. The +**CurrentPowerShellTab** property of the `$psISE` variable represent the current session. The **Snippets** property represents snippets in the current session. -The `$PSISE.CurrentPowerShellTab.Snippets` command returns a +The `$psISE.CurrentPowerShellTab.Snippets` command returns a **Microsoft.PowerShell.Host.ISE.ISESnippet** object that represents a snippet, unlike the `Get-IseSnippet` cmdlet. `Get-IseSnippet` returns a file object (System.Io.FileInfo) that represents a snippet file. diff --git a/reference/5.1/ISE/Import-IseSnippet.md b/reference/5.1/ISE/Import-IseSnippet.md index 109e7c562147..79a6891690f1 100644 --- a/reference/5.1/ISE/Import-IseSnippet.md +++ b/reference/5.1/ISE/Import-IseSnippet.md @@ -92,7 +92,7 @@ you don't need to run a command like this because modules that have snippets wil ```powershell ($env:PSModulePath).split(";") | ForEach-Object {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | - ForEach-Object {$psise.CurrentPowerShellTab.Snippets.Load($_)} + ForEach-Object {$psISE.CurrentPowerShellTab.Snippets.Load($_)} ``` ### Example 5: Copy all module snippets diff --git a/reference/5.1/ISE/New-IseSnippet.md b/reference/5.1/ISE/New-IseSnippet.md index 9d283d33b3a4..00c681717119 100644 --- a/reference/5.1/ISE/New-IseSnippet.md +++ b/reference/5.1/ISE/New-IseSnippet.md @@ -244,7 +244,7 @@ For more information about Windows PowerShell execution policies, see Windows PowerShell ISE. - To delete a snippet that you added, delete the snippet file. - You cannot delete a built-in snippet, but you can hide all built-in snippets by using the - "$psise.Options.ShowDefaultSnippets=$false" command. + "$psISE.Options.ShowDefaultSnippets=$false" command. - You can create a snippet that has the same name as a built-in snippet. Both snippets appear in the snippet menu in Windows PowerShell ISE. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md index 21ee90bcc12d..2cf55e2e5aea 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md @@ -165,7 +165,7 @@ following command sequence. ```powershell $m = Get-PSSnapin Microsoft.PowerShell.Core -$m.LogPipelineExecutionDetails = $True +$m.LogPipelineExecutionDetails = $true ``` To disable logging, use the same command sequence to set the property value to diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md index c64e56b4a208..5c83ab80691e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md @@ -149,7 +149,7 @@ The next command copies the file contents to a new file, `MyDotNetTypes.Format.ps1xml`. ```powershell -Copy-Item $PSHome\DotNetTypes.format.ps1xml MyDotNetTypes.Format.ps1xml +Copy-Item $PSHOME\DotNetTypes.format.ps1xml MyDotNetTypes.Format.ps1xml ``` Open the `MyDotNetTypes.Format.ps1xml` file in any XML or text editor, such as @@ -451,7 +451,7 @@ $Parms = @{ Pattern = "System.IO.DirectoryInfo" } Select-String @Parms -Copy-Item $PSHome\FileSystem.format.ps1xml .\MyFileSystem.Format.ps1xml +Copy-Item $PSHOME\FileSystem.format.ps1xml .\MyFileSystem.Format.ps1xml Update-FormatData -PrependPath $PSHOME\Format\MyFileSystem.Format.ps1xml ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index 4c8e3e042582..c96186af01c8 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -34,10 +34,10 @@ The following table lists the preference variables and their default values. | [`$InformationPreference`][07] | [`SilentlyContinue`][54] | | [`$LogCommandHealthEvent`][08] | `$false` (not logged) | | [`$LogCommandLifecycleEvent`][08] | `$false` (not logged) | -| [`$LogEngineHealthEvent`][08] | `$True` (logged) | -| [`$LogEngineLifecycleEvent`][08] | `$True` (logged) | -| [`$LogProviderLifecycleEvent`][08] | `$True` (logged) | -| [`$LogProviderHealthEvent`][08] | `$True` (logged) | +| [`$LogEngineHealthEvent`][08] | `$true` (logged) | +| [`$LogEngineLifecycleEvent`][08] | `$true` (logged) | +| [`$LogProviderLifecycleEvent`][08] | `$true` (logged) | +| [`$LogProviderHealthEvent`][08] | `$true` (logged) | | [`$MaximumAliasCount`][09] | `4096` | | [`$MaximumDriveCount`][10] | `4096` | | [`$MaximumErrorCount`][11] | `256` | @@ -48,12 +48,12 @@ The following table lists the preference variables and their default values. | [`$OutputEncoding`][16] | [`ASCIIEncoding`][60] object | | [`$ProgressPreference`][17] | [`Continue`][54] | | [`$PSDefaultParameterValues`][18] | `@{}` (empty hash table) | -| [`$PSEmailServer`][19] | `$Null` (none) | +| [`$PSEmailServer`][19] | `$null` (none) | | [`$PSModuleAutoLoadingPreference`][20] | `All` | | [`$PSSessionApplicationName`][21] | `'wsman'` | | [`$PSSessionConfigurationName`][22] | `'http://schemas.microsoft.com/powershell/Microsoft.PowerShell'` | | [`$PSSessionOption`][23] | [`PSSessionOption`][59] object | -| [`$Transcript`][24] | `$Null` (none) | +| [`$Transcript`][24] | `$null` (none) | | [`$VerbosePreference`][25] | [`SilentlyContinue`][54] | | [`$WarningPreference`][26] | [`Continue`][54] | | [`$WhatIfPreference`][27] | `$false` | diff --git a/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md b/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md index 038380b3d685..25560391ce3c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md @@ -36,11 +36,11 @@ For more information about Windows PowerShell snap-ins, see [about_PSSnapins](Ab ### Example 1: Export the names of snap-ins in the current session ``` -PS C:\> Export-Console -Path $pshome\Consoles\ConsoleS1.psc1 +PS C:\> Export-Console -Path $PSHOME\Consoles\ConsoleS1.psc1 ``` This command exports the names of Windows PowerShell snap-ins in the current session to the -`ConsoleS1.psc1` file in the Consoles folder of the Windows PowerShell installation folder, `$pshome`. +`ConsoleS1.psc1` file in the Consoles folder of the Windows PowerShell installation folder, `$PSHOME`. ### Example 2: Export the names of snap-ins to the most recent console file diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md b/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md index b2352f510e6f..21d7ec1e481b 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-ComputerSecureChannel.md @@ -27,7 +27,7 @@ The `Test-ComputerSecureChannel` cmdlet verifies that the channel between the lo domain is working correctly by checking the status of its trust relationships. If a connection fails, you can use the **Repair** parameter to try to restore it. -`Test-ComputerSecureChannel` returns $True if the channel is working correctly and $false if it is +`Test-ComputerSecureChannel` returns $true if the channel is working correctly and $false if it is not. This result lets you use the cmdlet in conditional statements in functions and scripts. To get more detailed test results, use the **Verbose** parameter. @@ -200,7 +200,7 @@ You cannot pipe input to this cmdlet. ### System.Boolean -This cmdlet returns `$True` if the connection is working correctly and `$false` if it is not. +This cmdlet returns `$true` if the connection is working correctly and `$false` if it is not. ## NOTES diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md index 8f34bdae8957..c0b396a14944 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md @@ -225,7 +225,7 @@ interchangeably. This command uses the **PrivateData** property of `$Host` as its ErrorBackgroundColor property. To see all of the properties of the object in the `$Host`.PrivateData property, type -`$host.PrivateData | format-list *`. +`$Host.PrivateData | format-list *`. ## PARAMETERS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 1897c96d33f6..e8361338ad91 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -84,7 +84,7 @@ $Cred = Get-Credential # Next, allow the use of self-signed SSL certificates. -[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $True } +[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } # Create variables to store the values consumed by the Invoke-RestMethod command. # The search variable contents are later embedded in the body variable. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Update-FormatData.md b/reference/5.1/Microsoft.PowerShell.Utility/Update-FormatData.md index 7f379d27436e..3e633b036144 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Update-FormatData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Update-FormatData.md @@ -32,7 +32,7 @@ Formatting files are text files in XML format with the `format.ps1xml` file name formatting data in the files defines the display of Microsoft .NET Framework objects in the session. When Windows PowerShell starts, it loads the format data from the formatting files in the PowerShell -installation directory (`$pshome`) into the session. You can use `Update-FormatData` to reload the +installation directory (`$PSHOME`) into the session. You can use `Update-FormatData` to reload the formatting data into the current session without restarting PowerShell. This is useful when you have added or changed a formatting file, but do not want to interrupt the session. diff --git a/reference/5.1/PSDiagnostics/Set-LogProperties.md b/reference/5.1/PSDiagnostics/Set-LogProperties.md index 4e633aa43c86..b7ce76a79d45 100644 --- a/reference/5.1/PSDiagnostics/Set-LogProperties.md +++ b/reference/5.1/PSDiagnostics/Set-LogProperties.md @@ -32,7 +32,7 @@ You must run this cmdlet from an elevated PowerShell session. ```powershell $logDetails = Get-LogProperties 'Windows PowerShell' -$logDetails.Retention = $True +$logDetails.Retention = $true Set-LogProperties -LogDetails $logDetails Get-LogProperties 'Windows PowerShell' ``` diff --git a/reference/5.1/PSReadLine/About/about_PSReadLine.md b/reference/5.1/PSReadLine/About/about_PSReadLine.md index b0eaea6d321e..43ec4957441c 100644 --- a/reference/5.1/PSReadLine/About/about_PSReadLine.md +++ b/reference/5.1/PSReadLine/About/about_PSReadLine.md @@ -124,7 +124,7 @@ APIs are documented in [about_PSReadLine_Functions][02]. PSReadLine maintains a history file containing all the commands and data you've entered from the command line. The history files are a file named -`$($host.Name)_history.txt`. On Windows systems the history file is stored at +`$($Host.Name)_history.txt`. On Windows systems the history file is stored at `$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine`. The history can contain sensitive data including passwords. PSReadLine attempts diff --git a/reference/5.1/PSReadLine/Set-PSReadLineOption.md b/reference/5.1/PSReadLine/Set-PSReadLineOption.md index a25224bb7195..2770dedfd7b4 100644 --- a/reference/5.1/PSReadLine/Set-PSReadLineOption.md +++ b/reference/5.1/PSReadLine/Set-PSReadLineOption.md @@ -208,7 +208,7 @@ For example, the following example creates a prompt that contains the current pa greater-than character (`>`) and a space. ```powershell -function prompt { "PS $pwd> " }` +function prompt { "PS $PWD> " }` Set-PSReadLineOption -PromptText '> ' # change the '>' character red Set-PSReadLineOption -PromptText '> ', 'X ' # replace the '>' character with a red 'X' ``` diff --git a/reference/5.1/PSScheduledJob/Disable-JobTrigger.md b/reference/5.1/PSScheduledJob/Disable-JobTrigger.md index cc0af8776e34..a9b71b5c8b73 100644 --- a/reference/5.1/PSScheduledJob/Disable-JobTrigger.md +++ b/reference/5.1/PSScheduledJob/Disable-JobTrigger.md @@ -30,7 +30,7 @@ triggers to `Disable-JobTrigger` or use its **InputObject** parameter. To disable a job trigger, the `Disable-JobTrigger` cmdlet sets the Enabled property of the job trigger to `$false`. To re-enable the job trigger, use the `Enable-JobTrigger` cmdlet, which sets -the **Enabled** property of the job trigger to $True. Disabling a job trigger does not disable the +the **Enabled** property of the job trigger to $true. Disabling a job trigger does not disable the scheduled job, such as is done by the `Disable-ScheduledJob` cmdlet, but if you disable all job triggers, the effect is the same as disabling the scheduled job. diff --git a/reference/5.1/PSScheduledJob/Get-ScheduledJobOption.md b/reference/5.1/PSScheduledJob/Get-ScheduledJobOption.md index 23654d132266..a8cb12aff782 100644 --- a/reference/5.1/PSScheduledJob/Get-ScheduledJobOption.md +++ b/reference/5.1/PSScheduledJob/Get-ScheduledJobOption.md @@ -87,7 +87,7 @@ Get-ScheduledJob | Get-ScheduledJobOption | Where {$_.RunElevated -and !$_.Waket ForEach-Object {$_.JobDefinition} ``` -The first command gets job options in which the RunElevated property has a value of $True and the +The first command gets job options in which the RunElevated property has a value of $true and the **RunWithoutNetwork** property has a value of `$false`. The output shows the **JobOptions** object that was selected. diff --git a/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md b/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md index 0fdf4bf41ce6..53a80127e7f4 100644 --- a/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md +++ b/reference/5.1/PSScheduledJob/New-ScheduledJobOption.md @@ -500,7 +500,7 @@ This cmdlet returns a **ScheduledJobOptions** object representing the created op **ScheduledJobOption** parameter can also take a hash table value that specifies the properties of the **ScheduledJobOptions** object and their values, such as: - `@{ShowInTaskScheduler=$false; RunElevated=$True; IdleDuration="00:05"}` + `@{ShowInTaskScheduler=$false; RunElevated=$true; IdleDuration="00:05"}` ## RELATED LINKS diff --git a/reference/5.1/PSScheduledJob/Register-ScheduledJob.md b/reference/5.1/PSScheduledJob/Register-ScheduledJob.md index 5d44bc292025..5ca092259ee9 100644 --- a/reference/5.1/PSScheduledJob/Register-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Register-ScheduledJob.md @@ -464,7 +464,7 @@ options, including the default values, see `New-ScheduledJobOption`. To submit a hash table, use the following keys. In the following hash table, the keys are shown with their default values. -`@{StartIfOnBattery=$false; StopIfGoingOnBattery=$True; WakeToRun=$false; StartIfNotIdle=$false; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$True; RestartOnIdleResume=$false; ShowInTaskScheduler=$True; RunElevated=$false; RunWithoutNetwork=$false; DoNotAllowDemandStart=$false; MultipleInstancePolicy="IgnoreNew"}` +`@{StartIfOnBattery=$false; StopIfGoingOnBattery=$true; WakeToRun=$false; StartIfNotIdle=$false; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$true; RestartOnIdleResume=$false; ShowInTaskScheduler=$true; RunElevated=$false; RunWithoutNetwork=$false; DoNotAllowDemandStart=$false; MultipleInstancePolicy="IgnoreNew"}` ```yaml Type: Microsoft.PowerShell.ScheduledJob.ScheduledJobOptions diff --git a/reference/5.1/PSScheduledJob/Set-ScheduledJob.md b/reference/5.1/PSScheduledJob/Set-ScheduledJob.md index d752adf705ee..e5d85d65070e 100644 --- a/reference/5.1/PSScheduledJob/Set-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Set-ScheduledJob.md @@ -443,7 +443,7 @@ options, including the default values, see `New-ScheduledJobOption`. To submit a hash table, use the following keys. In the following hash table, the keys are shown with their default values. -`@{# Power SettingsStartIfOnBattery=$false;StopIfGoingOnBattery=$True; WakeToRun=$false; # Idle SettingsStartIfNotIdle=$false; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$True; RestartOnIdleResume=$false;# Security settingsShowInTaskScheduler=$TrueRunElevated=$false;# MiscRunWithoutNetwork=$false;DoNotAllowDemandStart=$false;MultipleInstancePolicy=IgnoreNew# Can be IgnoreNew, Parallel, Queue, StopExisting}` +`@{# Power SettingsStartIfOnBattery=$false;StopIfGoingOnBattery=$true; WakeToRun=$false; # Idle SettingsStartIfNotIdle=$false; IdleDuration="00:10:00"; IdleTimeout="01:00:00"; StopIfGoingOffIdle=$true; RestartOnIdleResume=$false;# Security settingsShowInTaskScheduler=$trueRunElevated=$false;# MiscRunWithoutNetwork=$false;DoNotAllowDemandStart=$false;MultipleInstancePolicy=IgnoreNew# Can be IgnoreNew, Parallel, Queue, StopExisting}` ```yaml Type: Microsoft.PowerShell.ScheduledJob.ScheduledJobOptions diff --git a/reference/5.1/PSScheduledJob/Set-ScheduledJobOption.md b/reference/5.1/PSScheduledJob/Set-ScheduledJobOption.md index 647273b6d656..1606c01ab6cb 100644 --- a/reference/5.1/PSScheduledJob/Set-ScheduledJobOption.md +++ b/reference/5.1/PSScheduledJob/Set-ScheduledJobOption.md @@ -103,7 +103,7 @@ DeployPackage scheduled job. The output shows that the WakeToRun and RunElevated to `$false`. The second command uses the `Set-ScheduledJobOpton` cmdlet to change the job options so the values -of the WakeToRun and RunWithoutNetwork properties are $True. The command uses the **PassThru** +of the WakeToRun and RunWithoutNetwork properties are $true. The command uses the **PassThru** parameter to return the trigger after the change. This command is not required; it is included only to show the effect of the option change. @@ -236,7 +236,7 @@ Enter a timespan object, such as one generated by the `New-TimeSpan` cmdlet, or `::` format that is automatically converted to a **TimeSpan** object. To enable this value, use the **StartIfIdle** parameter. By default, the StartIfNotIdle property of -scheduled jobs is set to $True and Windows PowerShell ignores the **IdleDuration** and +scheduled jobs is set to $true and Windows PowerShell ignores the **IdleDuration** and **IdleTimeout** values. ```yaml diff --git a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md index 986dac8d2690..cd7934f351fc 100644 --- a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md @@ -64,7 +64,7 @@ This section describes the activity common parameters. #### AppendOutput \ -A value of `$True` adds the output of the activity to the value of the variable. +A value of `$true` adds the output of the activity to the value of the variable. A value of `$false` has no effect. By default, assigning a value to a variable replaces the variable value. @@ -144,7 +144,7 @@ piping objects to the activity one at a time. #### MergeErrorToOutput \ -A value of `$True` adds errors to the output stream. A value of `$false` has +A value of `$true` adds errors to the output stream. A value of `$false` has no effect. Use this parameter with the **Parallel** and `ForEach -Parallel` keywords to collect errors and output from multiple parallel commands in a single collection. @@ -169,14 +169,14 @@ affected target computer. #### PSAllowRedirection \ -A value of `$True` allows redirection of the connection to the target computers. +A value of `$true` allows redirection of the connection to the target computers. A value of `$false` has no effect. This activity common parameter is also a workflow common parameter. When you use the **PSConnectionURI** parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you can use the **PSAllowRedirection** parameter -with a value of `$True` to allow redirection of the connection to the target +with a value of `$true` to allow redirection of the connection to the target computer. You can also limit the number of times that the connection is redirected by @@ -338,8 +338,8 @@ Workflow Test-Workflow { $debugCollection = New-Object -Type ` System.Management.Automation.PSDataCollection[System.Management.Automation.DebugRecord] - InlineScript {\Server01\Share01\Get-AssetData.ps1} -PSDebug $debugCollection -Debug $True - InlineScript {\Server01\Share01\Set-AssetData.ps1} -PSDebug $debugCollection -Debug $True + InlineScript {\Server01\Share01\Get-AssetData.ps1} -PSDebug $debugCollection -Debug $true + InlineScript {\Server01\Share01\Set-AssetData.ps1} -PSDebug $debugCollection -Debug $true if ($debugCollection -like "Missing") { ...} } ``` @@ -362,7 +362,7 @@ Valid values: - (Default) If omitted, and you have also not added the **PSDisableSerialization** parameter to an activity, objects are serialized. -- `$True`. Directs all activities within a workflow to return +- `$true`. Directs all activities within a workflow to return "live" (not serialized) objects. The resulting objects have methods, as well as properties, but they cannot be saved when a checkpoint is taken. - `$false`. Workflow objects are serialized. @@ -411,7 +411,7 @@ Valid values: - (Default) If you omit this parameter, no checkpoints are added. Checkpoints are taken based on the settings for the workflow. -- `$True`. Takes a checkpoint after the activity completes. This checkpoint is +- `$true`. Takes a checkpoint after the activity completes. This checkpoint is in addition to any checkpoints that are specified in the workflow. - `$false`. No checkpoints are added. Checkpoints are taken only when specified @@ -499,7 +499,7 @@ For more information about the `$PSSessionOption` preference variable, see #### PSUseSSL \ -A value of `$True` uses the Secure Sockets Layer (SSL) protocol to establish a +A value of `$true` uses the Secure Sockets Layer (SSL) protocol to establish a connection to the target computer. By default, SSL is not used. A value of `$false` has no effect. This activity common parameter is also a workflow common parameter. @@ -539,7 +539,7 @@ activity. ```powershell workflow Test-Workflow { - Get-Service -UseDefaultInput $True + Get-Service -UseDefaultInput $true } PS C:> Test-Workflow -InputObject WinRm diff --git a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md index 337fc6bdcde4..d49ecc2a2e2d 100644 --- a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -288,7 +288,7 @@ Valid values: and end of the workflow, in addition to any checkpoints that are specified in the workflow. -- `$True`. Adds a checkpoint to the beginning and end of the workflow and a +- `$true`. Adds a checkpoint to the beginning and end of the workflow and a checkpoint after each activity, in addition to any checkpoints that are specified in the workflow. diff --git a/reference/5.1/PSWorkflow/About/about_Workflows.md b/reference/5.1/PSWorkflow/About/about_Workflows.md index 14eaa8e50406..7196f18f447a 100644 --- a/reference/5.1/PSWorkflow/About/about_Workflows.md +++ b/reference/5.1/PSWorkflow/About/about_Workflows.md @@ -240,7 +240,7 @@ workflows that don't define persistence points. ```powershell Invoke-Command -Session $ws { - Test-Workflow -PSComputerName Server01, Server02 -PSPersist:$True + Test-Workflow -PSComputerName Server01, Server02 -PSPersist:$true } ``` diff --git a/reference/7.4/PSDiagnostics/Set-LogProperties.md b/reference/7.4/PSDiagnostics/Set-LogProperties.md index bfd8593adc92..1ecfa1a46c4f 100644 --- a/reference/7.4/PSDiagnostics/Set-LogProperties.md +++ b/reference/7.4/PSDiagnostics/Set-LogProperties.md @@ -34,7 +34,7 @@ You must run this cmdlet from an elevated PowerShell session. ```powershell $logDetails = Get-LogProperties 'Windows PowerShell' -$logDetails.Retention = $True +$logDetails.Retention = $true Set-LogProperties -LogDetails $logDetails Get-LogProperties 'Windows PowerShell' ``` diff --git a/reference/7.4/PSReadLine/About/about_PSReadLine.md b/reference/7.4/PSReadLine/About/about_PSReadLine.md index ccbd49146435..e890ccaf678b 100644 --- a/reference/7.4/PSReadLine/About/about_PSReadLine.md +++ b/reference/7.4/PSReadLine/About/about_PSReadLine.md @@ -159,7 +159,7 @@ APIs are documented in [about_PSReadLine_Functions][02]. PSReadLine maintains a history file containing all the commands and data you've entered from the command line. The history files are a file named -`$($host.Name)_history.txt`. On Windows systems the history file is stored at +`$($Host.Name)_history.txt`. On Windows systems the history file is stored at `$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine`. On non-Windows systems, the history files are stored at `$env:XDG_DATA_HOME/powershell/PSReadLine` or `$env:HOME/.local/share/powershell/PSReadLine`. diff --git a/reference/7.4/PSReadLine/Set-PSReadLineOption.md b/reference/7.4/PSReadLine/Set-PSReadLineOption.md index 8fff7bc675e8..113c5d19d6f8 100644 --- a/reference/7.4/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.4/PSReadLine/Set-PSReadLineOption.md @@ -209,7 +209,7 @@ For example, the following example creates a prompt that contains the current pa greater-than character (`>`) and a space. ```powershell -function prompt { "PS $pwd> " }` +function prompt { "PS $PWD> " }` Set-PSReadLineOption -PromptText '> ' # change the '>' character red Set-PSReadLineOption -PromptText '> ', 'X ' # replace the '>' character with a red 'X' ``` diff --git a/reference/7.4/ThreadJob/Start-ThreadJob.md b/reference/7.4/ThreadJob/Start-ThreadJob.md index 6b0509f6a56a..7ed7e138d355 100644 --- a/reference/7.4/ThreadJob/Start-ThreadJob.md +++ b/reference/7.4/ThreadJob/Start-ThreadJob.md @@ -284,7 +284,7 @@ Accept wildcard characters: False ### -ScriptBlock Specifies the commands to run in the background job. Enclose the commands in braces (`{}`) to create -a script block. Use the `$Input` automatic variable to access the value of the **InputObject** +a script block. Use the `$input` automatic variable to access the value of the **InputObject** parameter. This parameter is required. ```yaml diff --git a/reference/7.5/PSDiagnostics/Set-LogProperties.md b/reference/7.5/PSDiagnostics/Set-LogProperties.md index dbbdafe670b8..0aa84d75c155 100644 --- a/reference/7.5/PSDiagnostics/Set-LogProperties.md +++ b/reference/7.5/PSDiagnostics/Set-LogProperties.md @@ -34,7 +34,7 @@ You must run this cmdlet from an elevated PowerShell session. ```powershell $logDetails = Get-LogProperties 'Windows PowerShell' -$logDetails.Retention = $True +$logDetails.Retention = $true Set-LogProperties -LogDetails $logDetails Get-LogProperties 'Windows PowerShell' ``` diff --git a/reference/7.5/PSReadLine/About/about_PSReadLine.md b/reference/7.5/PSReadLine/About/about_PSReadLine.md index ef38bbed273d..9f28f3b61945 100644 --- a/reference/7.5/PSReadLine/About/about_PSReadLine.md +++ b/reference/7.5/PSReadLine/About/about_PSReadLine.md @@ -159,7 +159,7 @@ APIs are documented in [about_PSReadLine_Functions][02]. PSReadLine maintains a history file containing all the commands and data you've entered from the command line. The history files are a file named -`$($host.Name)_history.txt`. On Windows systems the history file is stored at +`$($Host.Name)_history.txt`. On Windows systems the history file is stored at `$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine`. On non-Windows systems, the history files are stored at `$env:XDG_DATA_HOME/powershell/PSReadLine` or `$env:HOME/.local/share/powershell/PSReadLine`. diff --git a/reference/7.5/PSReadLine/Set-PSReadLineOption.md b/reference/7.5/PSReadLine/Set-PSReadLineOption.md index 677319c659bc..62e7c9bf391e 100644 --- a/reference/7.5/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.5/PSReadLine/Set-PSReadLineOption.md @@ -209,7 +209,7 @@ For example, the following example creates a prompt that contains the current pa greater-than character (`>`) and a space. ```powershell -function prompt { "PS $pwd> " }` +function prompt { "PS $PWD> " }` Set-PSReadLineOption -PromptText '> ' # change the '>' character red Set-PSReadLineOption -PromptText '> ', 'X ' # replace the '>' character with a red 'X' ``` diff --git a/reference/7.5/ThreadJob/Start-ThreadJob.md b/reference/7.5/ThreadJob/Start-ThreadJob.md index 3b49d1e63682..116aaef8f0a2 100644 --- a/reference/7.5/ThreadJob/Start-ThreadJob.md +++ b/reference/7.5/ThreadJob/Start-ThreadJob.md @@ -284,7 +284,7 @@ Accept wildcard characters: False ### -ScriptBlock Specifies the commands to run in the background job. Enclose the commands in braces (`{}`) to create -a script block. Use the `$Input` automatic variable to access the value of the **InputObject** +a script block. Use the `$input` automatic variable to access the value of the **InputObject** parameter. This parameter is required. ```yaml diff --git a/reference/7.6/PSDiagnostics/Set-LogProperties.md b/reference/7.6/PSDiagnostics/Set-LogProperties.md index 5eda6e7cb753..7b52d7147afe 100644 --- a/reference/7.6/PSDiagnostics/Set-LogProperties.md +++ b/reference/7.6/PSDiagnostics/Set-LogProperties.md @@ -34,7 +34,7 @@ You must run this cmdlet from an elevated PowerShell session. ```powershell $logDetails = Get-LogProperties 'Windows PowerShell' -$logDetails.Retention = $True +$logDetails.Retention = $true Set-LogProperties -LogDetails $logDetails Get-LogProperties 'Windows PowerShell' ``` diff --git a/reference/7.6/PSReadLine/About/about_PSReadLine.md b/reference/7.6/PSReadLine/About/about_PSReadLine.md index 9333ca14ac1c..f946aa96adf2 100644 --- a/reference/7.6/PSReadLine/About/about_PSReadLine.md +++ b/reference/7.6/PSReadLine/About/about_PSReadLine.md @@ -159,7 +159,7 @@ APIs are documented in [about_PSReadLine_Functions][02]. PSReadLine maintains a history file containing all the commands and data you've entered from the command line. The history files are a file named -`$($host.Name)_history.txt`. On Windows systems the history file is stored at +`$($Host.Name)_history.txt`. On Windows systems the history file is stored at `$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine`. On non-Windows systems, the history files are stored at `$env:XDG_DATA_HOME/powershell/PSReadLine` or `$env:HOME/.local/share/powershell/PSReadLine`. diff --git a/reference/7.6/PSReadLine/Set-PSReadLineOption.md b/reference/7.6/PSReadLine/Set-PSReadLineOption.md index b14d2b424a57..4b167da3728e 100644 --- a/reference/7.6/PSReadLine/Set-PSReadLineOption.md +++ b/reference/7.6/PSReadLine/Set-PSReadLineOption.md @@ -209,7 +209,7 @@ For example, the following example creates a prompt that contains the current pa greater-than character (`>`) and a space. ```powershell -function prompt { "PS $pwd> " }` +function prompt { "PS $PWD> " }` Set-PSReadLineOption -PromptText '> ' # change the '>' character red Set-PSReadLineOption -PromptText '> ', 'X ' # replace the '>' character with a red 'X' ``` diff --git a/reference/7.6/ThreadJob/Start-ThreadJob.md b/reference/7.6/ThreadJob/Start-ThreadJob.md index b16ca6f3366c..14fa64c7df15 100644 --- a/reference/7.6/ThreadJob/Start-ThreadJob.md +++ b/reference/7.6/ThreadJob/Start-ThreadJob.md @@ -284,7 +284,7 @@ Accept wildcard characters: False ### -ScriptBlock Specifies the commands to run in the background job. Enclose the commands in braces (`{}`) to create -a script block. Use the `$Input` automatic variable to access the value of the **InputObject** +a script block. Use the `$input` automatic variable to access the value of the **InputObject** parameter. This parameter is required. ```yaml From aad23384dd8a40c54d61ea11820e9ad1733291cd Mon Sep 17 00:00:00 2001 From: surfingoldelephant <151538956+surfingoldelephant@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:52:21 +0000 Subject: [PATCH 16/16] Fix automatic variable case (#11838) --- .../cmdlet/extending-output-objects.md | 4 ++-- .../format/powershell-formatting-files.md | 2 +- .../developer/hosting/host04-sample.md | 4 ++-- .../developer/hosting/host05-sample.md | 4 ++-- .../developer/hosting/host06-sample.md | 4 ++-- ...ow-to-write-a-powershell-module-manifest.md | 2 +- .../module/installing-a-powershell-module.md | 2 +- reference/docs-conceptual/how-to-use-docs.md | 2 +- .../docs-conceptual/lang-spec/chapter-04.md | 2 +- .../docs-conceptual/lang-spec/chapter-07.md | 16 ++++++++-------- .../docs-conceptual/lang-spec/chapter-08.md | 6 +++--- .../docs-conceptual/lang-spec/chapter-12.md | 6 +++--- .../deep-dives/everything-about-arrays.md | 2 +- .../deep-dives/everything-about-hashtable.md | 4 ++-- .../deep-dives/everything-about-switch.md | 10 +++++----- ...eating-.NET-and-COM-Objects--New-Object-.md | 4 ++-- ...owerShell-Command-from-a-Running-Process.md | 2 +- .../samples/Working-with-Registry-Entries.md | 6 +++--- .../security/preventing-script-injection.md | 18 +++++++++--------- .../remoting/powershell-remoting-faq.yml | 8 ++++---- .../whats-new/What-s-New-in-PowerShell-74.md | 2 +- .../whats-new/What-s-New-in-PowerShell-75.md | 4 ++-- ...-Debug-Scripts-in-Windows-PowerShell-ISE.md | 4 ++-- .../The-ISEFileCollection-Object.md | 2 +- .../The-ISESnippetCollection-Object.md | 2 +- tests/Pester/Update-Help.Tests.ps1 | 16 ++++++++-------- 26 files changed, 69 insertions(+), 69 deletions(-) diff --git a/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md b/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md index 86ac1e3fe5ed..0027a132878a 100644 --- a/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md +++ b/reference/docs-conceptual/developer/cmdlet/extending-output-objects.md @@ -6,7 +6,7 @@ title: Extending Output Objects --- # Extending Output Objects -You can extend the .NET Framework objects that are returned by cmdlets, functions, and scripts by using types files (.ps1xml). Types files are XML-based files that let you add properties and methods to existing objects. For example, Windows PowerShell provides the Types.ps1xml file, which adds elements to several existing .NET Framework objects. The Types.ps1xml file is located in the Windows PowerShell installation directory (`$pshome`). You can create your own types file to further extend those objects or to extend other objects. When you extend an object by using a types file, any instance of the object is extended with the new elements. +You can extend the .NET Framework objects that are returned by cmdlets, functions, and scripts by using types files (.ps1xml). Types files are XML-based files that let you add properties and methods to existing objects. For example, Windows PowerShell provides the Types.ps1xml file, which adds elements to several existing .NET Framework objects. The Types.ps1xml file is located in the Windows PowerShell installation directory (`$PSHOME`). You can create your own types file to further extend those objects or to extend other objects. When you extend an object by using a types file, any instance of the object is extended with the new elements. ## Extending the System.Array Object @@ -66,7 +66,7 @@ PS> (1, 2, 3, 4).Length ## Custom Types Files -To create a custom types file, start by copying an existing types file. The new file can have any name, but it must have a .ps1xml file name extension. When you copy the file, you can place the new file in any directory that is accessible to Windows PowerShell, but it is useful to place the files in the Windows PowerShell installation directory (`$pshome`) or in a subdirectory of the installation directory. +To create a custom types file, start by copying an existing types file. The new file can have any name, but it must have a .ps1xml file name extension. When you copy the file, you can place the new file in any directory that is accessible to Windows PowerShell, but it is useful to place the files in the Windows PowerShell installation directory (`$PSHOME`) or in a subdirectory of the installation directory. To add your own extended types to the file, add a types element for each object that you want to extend. The following topics provide examples. diff --git a/reference/docs-conceptual/developer/format/powershell-formatting-files.md b/reference/docs-conceptual/developer/format/powershell-formatting-files.md index 633708696ff9..ca395b3f8fd0 100644 --- a/reference/docs-conceptual/developer/format/powershell-formatting-files.md +++ b/reference/docs-conceptual/developer/format/powershell-formatting-files.md @@ -7,7 +7,7 @@ title: Windows PowerShell Formatting Files # Windows PowerShell Formatting Files Windows PowerShell provides several formatting files (.format.ps1xml) that are located in the -installation directory (`$pshome`). Each of these files defines the default display for a specific +installation directory (`$PSHOME`). Each of these files defines the default display for a specific set of .NET objects. These files should never be changed. However, you can use them as a reference for creating your own custom formatting files. diff --git a/reference/docs-conceptual/developer/hosting/host04-sample.md b/reference/docs-conceptual/developer/hosting/host04-sample.md index 04f4b827e699..651b174bd100 100644 --- a/reference/docs-conceptual/developer/hosting/host04-sample.md +++ b/reference/docs-conceptual/developer/hosting/host04-sample.md @@ -27,7 +27,7 @@ This sample requires Windows PowerShell 2.0. - Building a console application that uses these host classes to build an interactive Windows PowerShell shell. -- Creating a `$profile` variable and loading the following profiles. +- Creating a `$PROFILE` variable and loading the following profiles. - current user, current host - current user, all hosts @@ -145,7 +145,7 @@ namespace Microsoft.Samples.PowerShell.Host this.myRunSpace.Open(); // Create a PowerShell object that will be used to execute the commands - // to create $profile and load the profiles. + // to create $PROFILE and load the profiles. lock (this.instanceLock) { this.currentPowerShell = PowerShell.Create(); diff --git a/reference/docs-conceptual/developer/hosting/host05-sample.md b/reference/docs-conceptual/developer/hosting/host05-sample.md index 2dcfe7b49405..7387f75a9c6a 100644 --- a/reference/docs-conceptual/developer/hosting/host05-sample.md +++ b/reference/docs-conceptual/developer/hosting/host05-sample.md @@ -30,7 +30,7 @@ host application also supports calls to remote computers by using the - Building a console application that uses these host classes to build an interactive Windows PowerShell shell. -- Creating a `$profile` variable and loading the following profiles. +- Creating a `$PROFILE` variable and loading the following profiles. - current user, current host - current user, all hosts @@ -159,7 +159,7 @@ namespace Microsoft.Samples.PowerShell.Host this.myRunSpace.Open(); // Create a PowerShell object to run the commands used to create - // $profile and load the profiles. + // $PROFILE and load the profiles. lock (this.instanceLock) { this.currentPowerShell = PowerShell.Create(); diff --git a/reference/docs-conceptual/developer/hosting/host06-sample.md b/reference/docs-conceptual/developer/hosting/host06-sample.md index d7a5501a8340..1b53bf7767c2 100644 --- a/reference/docs-conceptual/developer/hosting/host06-sample.md +++ b/reference/docs-conceptual/developer/hosting/host06-sample.md @@ -29,7 +29,7 @@ the user. - Building a console application that uses these host classes to build an interactive Windows PowerShell shell. -- Creating a `$profile` variable and loading the following profiles. +- Creating a `$PROFILE` variable and loading the following profiles. - current user, current host - current user, all hosts @@ -165,7 +165,7 @@ namespace Microsoft.Samples.PowerShell.Host this.myRunSpace.Open(); // Create a PowerShell object to run the commands used to create - // $profile and load the profiles. + // $PROFILE and load the profiles. lock (this.instanceLock) { this.currentPowerShell = PowerShell.Create(); diff --git a/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md b/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md index 997b983d8f24..f21ecc650bc5 100644 --- a/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md +++ b/reference/docs-conceptual/developer/module/how-to-write-a-powershell-module-manifest.md @@ -93,7 +93,7 @@ The following table describes the elements you can include in a module manifest. | **Copyright**
Type: `String` | `'(c) . All rights reserved.'` | Copyright statement for this module. If a value isn't specified, `New-ModuleManifest` uses the default with the current user as the ``. To specify an author, use the **Author** parameter.
Example: `Copyright = '2019 AuthorName. All rights reserved.'` | | **Description**
Type: `String` | `` | Description of the functionality provided by this module.
Example: `Description = 'This is the module's description.'` | | **PowerShellVersion**
Type: `Version` | `` | Minimum version of the PowerShell engine required by this module. Valid values are 1.0, 2.0, 3.0, 4.0, 5.0, 5.1, 6.0, 6.1, 6.2, 7.0 and 7.1.
Example: `PowerShellVersion = '5.0'` | -| **PowerShellHostName**
Type: `String` | `` | Name of the PowerShell host required by this module. This name is provided by PowerShell. To find the name of a host program, in the program, type: `$host.name`.
Example: `PowerShellHostName = 'ConsoleHost'` | +| **PowerShellHostName**
Type: `String` | `` | Name of the PowerShell host required by this module. This name is provided by PowerShell. To find the name of a host program, in the program, type: `$Host.name`.
Example: `PowerShellHostName = 'ConsoleHost'` | | **PowerShellHostVersion**
Type: `Version` | `` | Minimum version of the PowerShell host required by this module.
Example: `PowerShellHostVersion = '2.0'` | | **DotNetFrameworkVersion**
Type: `Version` | `` | Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only, such as Windows PowerShell 5.1, and only applies to .NET Framework versions lower than 4.5.
Example: `DotNetFrameworkVersion = '3.5'` | | **CLRVersion**
Type: `Version` | `` | Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only, such as Windows PowerShell 5.1, and only applies to .NET Framework versions lower than 4.5.
Example: `CLRVersion = '3.5'` | diff --git a/reference/docs-conceptual/developer/module/installing-a-powershell-module.md b/reference/docs-conceptual/developer/module/installing-a-powershell-module.md index eff2532be081..48da1b5da3d6 100644 --- a/reference/docs-conceptual/developer/module/installing-a-powershell-module.md +++ b/reference/docs-conceptual/developer/module/installing-a-powershell-module.md @@ -33,7 +33,7 @@ PowerShell modules. Cmdlets rely on the value of this environment variable to fi By default, the **PSModulePath** environment variable value contains the following system and user module directories, but you can add to and edit the value. -- `$PSHome\Modules` (`%Windir%\System32\WindowsPowerShell\v1.0\Modules`) +- `$PSHOME\Modules` (`%Windir%\System32\WindowsPowerShell\v1.0\Modules`) > [!WARNING] > This location is reserved for modules that ship with Windows. Do not install modules to this diff --git a/reference/docs-conceptual/how-to-use-docs.md b/reference/docs-conceptual/how-to-use-docs.md index 66eb44c204cb..86f44cfa2d00 100644 --- a/reference/docs-conceptual/how-to-use-docs.md +++ b/reference/docs-conceptual/how-to-use-docs.md @@ -48,7 +48,7 @@ If there are version-specific differences, the documentation makes note of those ![Animation showing how to use the version selector.][04] -You can verify the version of PowerShell you are using by inspecting the `$PSversionTable.PSVersion` +You can verify the version of PowerShell you are using by inspecting the `$PSVersionTable.PSVersion` value. The following example shows the output for Windows PowerShell 5.1. ```powershell diff --git a/reference/docs-conceptual/lang-spec/chapter-04.md b/reference/docs-conceptual/lang-spec/chapter-04.md index 3991ecc3f294..977631b0e7c6 100644 --- a/reference/docs-conceptual/lang-spec/chapter-04.md +++ b/reference/docs-conceptual/lang-spec/chapter-04.md @@ -929,7 +929,7 @@ In PowerShell, this type is `System.Management.Automation.PSCustomObject`. The c ### 4.5.14 Command description type -The automatic variable `$PsCmdlet` is an object that represents the cmdlet or function being +The automatic variable `$PSCmdlet` is an object that represents the cmdlet or function being executed. The type of this object is implementation defined; it has the following accessible members: diff --git a/reference/docs-conceptual/lang-spec/chapter-07.md b/reference/docs-conceptual/lang-spec/chapter-07.md index 41a8dd230aeb..296b0998a84c 100644 --- a/reference/docs-conceptual/lang-spec/chapter-07.md +++ b/reference/docs-conceptual/lang-spec/chapter-07.md @@ -1698,10 +1698,10 @@ dash: Description: If the left operand does not designate a collection, the result has type `bool` and if that result -is `$true`, the elements of the Hashtable `$matches` are set to the strings that match (or +is `$true`, the elements of the Hashtable `$Matches` are set to the strings that match (or do-not-match) the value designated by the right operand. Otherwise, the result is a possibly empty unconstrained 1-dimensional array containing the elements of the collection that test True when -compared to the value designated by the right operand, and `$matches` is not set. The right operand +compared to the value designated by the right operand, and `$Matches` is not set. The right operand may designate a string that contains regular expressions ([§3.16][§3.16]), in which case, it is referred to as a _pattern_. These operators have two variants ([§7.8][§7.8]). @@ -1710,11 +1710,11 @@ These operators support submatches ([§7.8.4.6][§7.8.4.6]). Examples: ```powershell -"Hello" -match ".l" # True, $matches key/value is 0/"el" -"Hello" -match '\^h.*o$' # True, $matches key/value is +"Hello" -match ".l" # True, $Matches key/value is 0/"el" +"Hello" -match '\^h.*o$' # True, $Matches key/value is 0/"Hello" -"Hello" -cmatch '\^h.*o$' # False, $matches not set -"abc\^ef" -match ".\\\^e" # True, $matches key/value is 0/"c\^e" +"Hello" -cmatch '\^h.*o$' # False, $Matches not set +"abc\^ef" -match ".\\\^e" # True, $Matches key/value is 0/"c\^e" "abc" -notmatch "[A-Za-z]" # False "abc" -match "[\^A-Za-z]" # False @@ -1885,7 +1885,7 @@ _submatches_) delimited by parentheses. Consider the following example: `"red" -match "red"` -The result is `$true` and key 0 of `$matches` contains "red", that part of the string designated by +The result is `$true` and key 0 of `$Matches` contains "red", that part of the string designated by the left operand that exactly matched the pattern designated by the right operand. In the following example, the whole pattern is a submatch: @@ -1914,7 +1914,7 @@ In the case of `-replace`, the replacement text can access the submatches via na The resulting string is "the morning of Monday". -Instead of having keys in `$matches` be zero-based indexes, submatches can be named using the form +Instead of having keys in `$Matches` be zero-based indexes, submatches can be named using the form `?<*name*>`. For example, `"((r)e)(d)"` can be written with three named submatches, `m1`, `m2`, and `m3`, as follows: `"(?(?r)e)(?d)"`. diff --git a/reference/docs-conceptual/lang-spec/chapter-08.md b/reference/docs-conceptual/lang-spec/chapter-08.md index 1d270df94fae..a40a7fd6dc66 100644 --- a/reference/docs-conceptual/lang-spec/chapter-08.md +++ b/reference/docs-conceptual/lang-spec/chapter-08.md @@ -857,7 +857,7 @@ is case-insensitive. A pattern may contain a regular expression ([§3.16][§3.16]), in which case, regular expression string comparisons are performed, but only if the *switch-parameter* `-Regex` is present. By default, the -comparison is case-insensitive. If `-Regex` is present and a pattern is matched, `$matches` is +comparison is case-insensitive. If `-Regex` is present and a pattern is matched, `$Matches` is defined in the *switch-clause* *statement-block* for that pattern. A *switch-parameter* may be abbreviated; any distinct leading part of a parameter may be used. For @@ -1169,7 +1169,7 @@ only: - All operators except `-match` - The `if` statement -- The following automatic variables: `$PsCulture`, `$PsUICulture`, `$true`, `$false`, and `$null`. +- The following automatic variables: `$PSCulture`, `$PSUICulture`, `$true`, `$false`, and `$null`. - Comments - Pipelines - Statements separated by semicolons (`;`) @@ -1660,7 +1660,7 @@ function Test { [Parameter(Position = 0, ParameterSetname = "SetB")] [int]$in ) - $PsCmdlet.ParameterSetName + $PSCmdlet.ParameterSetName } Test 42d # outputs "SetA" diff --git a/reference/docs-conceptual/lang-spec/chapter-12.md b/reference/docs-conceptual/lang-spec/chapter-12.md index 13cdc3c64169..0f04a14309c7 100644 --- a/reference/docs-conceptual/lang-spec/chapter-12.md +++ b/reference/docs-conceptual/lang-spec/chapter-12.md @@ -179,7 +179,7 @@ conversion from `$null` to int. This attribute is used in the *attribute-list* of *param-block* of a function to indicate that function acts similar to a cmdlet. Specifically, it allows functions to access a number of methods -and properties through the $PsCmdlet variable by using begin, process, and end named blocks +and properties through the $PSCmdlet variable by using begin, process, and end named blocks ([§8.10.7][§8.10.7]). When this attribute is present, positional arguments that have no matching positional parameters @@ -322,11 +322,11 @@ ParameterSetName = "User")]
ParameterSetName = "Computer")]
[Parameter(ParameterSetName = "User")]
[int] $SharedParam = 5 )

-

if ($PsCmdlet.ParameterSetName -eq "Computer")
+

if ($PSCmdlet.ParameterSetName -eq "Computer")
{
# handle "Computer" parameter set
}

-

elseif ($PsCmdlet.ParameterSetName -eq "User")
+

elseif ($PSCmdlet.ParameterSetName -eq "User")
{
# handle "User" parameter set
}
diff --git a/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md b/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md index c1036cb8a72d..302b926ab45c 100644 --- a/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md +++ b/reference/docs-conceptual/learn/deep-dives/everything-about-arrays.md @@ -764,7 +764,7 @@ We can take the same approach with `Select-String`. $servers | Select-String SQL ``` -I take a closer look at `Select-String`,`-match` and the `$matches` variable in another post called +I take a closer look at `Select-String`,`-match` and the `$Matches` variable in another post called [The many ways to use regex][10]. ### $null or empty diff --git a/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md b/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md index afedbcccb808..6b14315f0e11 100644 --- a/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md +++ b/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md @@ -912,7 +912,7 @@ $PSDefaultParameterValues["Out-File:Encoding"] = "UTF8" This adds an entry to the `$PSDefaultParameterValues` hashtable that sets `UTF8` as the default value for the `Out-File -Encoding` parameter. This is session-specific so you should place it in -your `$profile`. +your `$PROFILE`. I use this often to pre-assign values that I type quite often. @@ -932,7 +932,7 @@ For a more in-depth breakdown, see this great article on [Automatic Defaults][Au ## Regex $Matches -When you use the `-match` operator, an automatic variable called `$matches` is created with the +When you use the `-match` operator, an automatic variable called `$Matches` is created with the results of the match. If you have any sub expressions in your regex, those sub matches are also listed. diff --git a/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md b/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md index b3b10ce22749..205b744b5330 100644 --- a/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md +++ b/reference/docs-conceptual/learn/deep-dives/everything-about-switch.md @@ -558,10 +558,10 @@ switch ( $age ) It still executes the same way and gives a better visual break when quickly looking at it. -### Regex $matches +### Regex $Matches We need to revisit regex to touch on something that isn't immediately obvious. The use of regex -populates the `$matches` variable. I do go into the use of `$matches` more when I talk about +populates the `$Matches` variable. I do go into the use of `$Matches` more when I talk about [The many ways to use regex][The many ways to use regex]. Here is a quick sample to show it in action with named matches. @@ -572,15 +572,15 @@ switch -Regex ($message) { '(?\d\d\d-\d\d-\d\d\d\d)' { - Write-Warning "message contains a SSN: $($matches.SSN)" + Write-Warning "message contains a SSN: $($Matches.SSN)" } '(?\d\d\d\d-\d\d\d\d-\d\d\d\d-\d\d\d\d)' { - Write-Warning "message contains a credit card number: $($matches.CC)" + Write-Warning "message contains a credit card number: $($Matches.CC)" } '(?\d\d\d-\d\d\d-\d\d\d\d)' { - Write-Warning "message contains a phone number: $($matches.Phone)" + Write-Warning "message contains a phone number: $($Matches.Phone)" } } ``` diff --git a/reference/docs-conceptual/samples/Creating-.NET-and-COM-Objects--New-Object-.md b/reference/docs-conceptual/samples/Creating-.NET-and-COM-Objects--New-Object-.md index f07064838be7..075e544c36df 100644 --- a/reference/docs-conceptual/samples/Creating-.NET-and-COM-Objects--New-Object-.md +++ b/reference/docs-conceptual/samples/Creating-.NET-and-COM-Objects--New-Object-.md @@ -276,10 +276,10 @@ TargetPath Property string TargetPath () {get} {set} We need to specify the **TargetPath**, which is the application folder for PowerShell, and then save the shortcut by calling the `Save` method. The PowerShell application folder path is stored in the -variable `$PSHome`, so we can do this by typing: +variable `$PSHOME`, so we can do this by typing: ```powershell -$lnk.TargetPath = $PSHome +$lnk.TargetPath = $PSHOME $lnk.Save() ``` diff --git a/reference/docs-conceptual/samples/Decode-PowerShell-Command-from-a-Running-Process.md b/reference/docs-conceptual/samples/Decode-PowerShell-Command-from-a-Running-Process.md index 04a3e57edc7d..7abaa92f2788 100644 --- a/reference/docs-conceptual/samples/Decode-PowerShell-Command-from-a-Running-Process.md +++ b/reference/docs-conceptual/samples/Decode-PowerShell-Command-from-a-Running-Process.md @@ -58,7 +58,7 @@ $commandDetails = $powerShellProcesses | Select-Object -Property ProcessId, expression = { if ( $_.CommandLine -match 'encodedCommand (.*) -inputFormat' ) { - return $matches[1] + return $Matches[1] } } } diff --git a/reference/docs-conceptual/samples/Working-with-Registry-Entries.md b/reference/docs-conceptual/samples/Working-with-Registry-Entries.md index 519c9a5e68b8..c39288cd43ac 100644 --- a/reference/docs-conceptual/samples/Working-with-Registry-Entries.md +++ b/reference/docs-conceptual/samples/Working-with-Registry-Entries.md @@ -195,7 +195,7 @@ The operation completed successfully. To add a new entry named "PowerShellPath" to the **CurrentVersion** key, use `New-ItemProperty` with the path to the key, the entry name, and the value of the entry. For this example, we will take the -value of the Windows PowerShell variable `$PSHome`, which stores the path to the installation +value of the Windows PowerShell variable `$PSHOME`, which stores the path to the installation directory for Windows PowerShell. You can add the new entry to the key using the following command, and the command also returns @@ -206,7 +206,7 @@ $newItemPropertySplat = @{ Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion' Name = 'PowerShellPath' PropertyType = 'String' - Value = $PSHome + Value = $PSHOME } New-ItemProperty @newItemPropertySplat ``` @@ -240,7 +240,7 @@ parameter: $newItemPropertySplat = @{ Name = 'PowerShellPath' PropertyType = 'String' - Value = $PSHome + Value = $PSHOME Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion', 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion' } diff --git a/reference/docs-conceptual/security/preventing-script-injection.md b/reference/docs-conceptual/security/preventing-script-injection.md index 47319e86724b..cd2f57146f14 100644 --- a/reference/docs-conceptual/security/preventing-script-injection.md +++ b/reference/docs-conceptual/security/preventing-script-injection.md @@ -34,7 +34,7 @@ another script that's parsed and run using the `Invoke-Expression` cmdlet. This when a valid process Id integer is passed in. ```powershell -Get-ProcessById $pid +Get-ProcessById $PID NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName ------ ----- ----- ------ -- -- ----------- @@ -45,10 +45,10 @@ However, the `$ProcId` parameter doesn't specify a type. It accepts any arbitrar can include other commands. ```powershell -Get-ProcessById "$pid; Write-Host 'pwnd!'" +Get-ProcessById "$PID; Write-Host 'pwnd!'" ``` -In this example, the function correctly retrieved the process identified by `$pid`, but also ran the +In this example, the function correctly retrieved the process identified by `$PID`, but also ran the injected script `Write-Host 'pwnd!'`. ```Output @@ -73,13 +73,13 @@ function Get-ProcessById Invoke-Expression -Command "Get-Process -Id $ProcId" } -Get-ProcessById "$pid; Write-Host 'pwnd!'" +Get-ProcessById "$PID; Write-Host 'pwnd!'" ``` ```Output Get-ProcessById: Line | - 7 | Get-ProcessById "$pid; Write-Host 'pwnd!'" + 7 | Get-ProcessById "$PID; Write-Host 'pwnd!'" | ~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot process argument transformation on parameter 'ProcId'. Cannot convert value "8064; Write-Host 'pwnd!'" to type "System.Int32". Error: "The input string '8064; Write-Host 'pwnd!' @@ -101,7 +101,7 @@ function Get-ProcessById Get-Process -Id $ProcId } -Get-ProcessById "$pid; Write-Host 'pwnd!'" +Get-ProcessById "$PID; Write-Host 'pwnd!'" ``` ```Output @@ -133,7 +133,7 @@ function Get-ProcessById Invoke-Expression -Command "Get-Process -Id '$ProcId'" } -Get-ProcessById "$pid; Write-Host 'pwnd!'" +Get-ProcessById "$PID; Write-Host 'pwnd!'" ``` ```Output @@ -145,7 +145,7 @@ However, this version of the function isn't yet completely safe from injection a user can still use single quotes in their input to inject code. ```powershell -Get-ProcessById "$pid'; Write-Host 'pwnd!';'" +Get-ProcessById "$PID'; Write-Host 'pwnd!';'" ``` This example uses single quotes in the user input to force the function to run three separate @@ -174,7 +174,7 @@ function Get-ProcessById EscapeSingleQuotedStringContent("$ProcId") Invoke-Expression -Command "Get-Process -Id '$ProcIdClean'" } -Get-ProcessById "$pid'; Write-Host 'pwnd!';'" +Get-ProcessById "$PID'; Write-Host 'pwnd!';'" ``` ```Output diff --git a/reference/docs-conceptual/security/remoting/powershell-remoting-faq.yml b/reference/docs-conceptual/security/remoting/powershell-remoting-faq.yml index 6a7aa9ccd299..21ed150f8181 100644 --- a/reference/docs-conceptual/security/remoting/powershell-remoting-faq.yml +++ b/reference/docs-conceptual/security/remoting/powershell-remoting-faq.yml @@ -219,7 +219,7 @@ sections: Where are my profiles? answer: | PowerShell profiles are not run automatically in remote sessions, so the commands that the - profile adds are not present in the session. In addition, the `$profile` automatic + profile adds are not present in the session. In addition, the `$PROFILE` automatic variable is not populated in remote sessions. To run a profile in a session, use the `Invoke-Command` cmdlet. @@ -228,16 +228,16 @@ sections: local computer in the session in `$s`. ``` - Invoke-Command -Session $s -FilePath $profile + Invoke-Command -Session $s -FilePath $PROFILE ``` The following command runs the **CurrentUserCurrentHost** profile from the remote computer - in the session in `$s`. Because the `$profile` variable is not populated, the command uses + in the session in `$s`. Because the `$PROFILE` variable is not populated, the command uses the explicit path to the profile. ```powershell Invoke-Command -Session $s { - . "$home\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" + . "$HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" } ``` diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-74.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-74.md index 0e1752d8d0d4..b1f62dfeeafe 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-74.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-74.md @@ -85,7 +85,7 @@ Many thanks to **@MartinGC94** and others for all their work to improve tab comp ([#17750][17750]) (Thanks @fflaten!). - Fix dynamic parameter completion ([#19510][19510]) - Add completion for variables assigned by the Data statement ([#19831][19831]) -- Fix expanding tilde (`~`) on Windows systems to `$home` to prevent breaking use cases with native +- Fix expanding tilde (`~`) on Windows systems to `$HOME` to prevent breaking use cases with native commands ([#21529][21529]) ## Web cmdlet improvements diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-75.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-75.md index cd989448ef42..2959bd1bc3b5 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-75.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-75.md @@ -40,7 +40,7 @@ Many thanks to **@ArmaanMcleod** and others for all their work to improve tab co - Fall back to type inference when hashtable key-value cannot be retrieved from safe expression ([#21184][21184]) (Thanks @MartinGC94!) - Fix the regression when doing type inference for `$_` ([#21223][21223]) (Thanks @MartinGC94!) -- Expand `~` to `$home` on Windows with tab completion ([#21529][21529]) +- Expand `~` to `$HOME` on Windows with tab completion ([#21529][21529]) - Don't complete when declaring parameter name and class member ([#21182][21182]) (Thanks @MartinGC94!) - Prevent fallback to file completion when tab completing type names ([#20084][20084]) (Thanks @@ -136,7 +136,7 @@ Many thanks to **@ArmaanMcleod** and others for all their work to improve tab co - Fix using assembly to use Path.Combine when constructing assembly paths ([#21169][21169]) - Validate the value for using namespace during semantic checks to prevent declaring invalid namespaces ([#21162][21162]) -- Handle global tool specially when prepending `$PSHome` to PATH ([#24228][24228]) +- Handle global tool specially when prepending `$PSHOME` to PATH ([#24228][24228]) ## Experimental features diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md index 13c4cd44c201..0018b13f5915 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md @@ -228,7 +228,7 @@ debugging a script. However, these methods do not work for the following automat - `$_` -- `$Input` +- `$input` - `$MyInvocation` @@ -238,7 +238,7 @@ debugging a script. However, these methods do not work for the following automat If you try to display the value of any of these variables, you get the value of that variable for in an internal pipeline the debugger uses, not the value of the variable in the script. You can work -around this for a few variables (`$_`, `$Input`, `$MyInvocation`, `$PSBoundParameters`, and `$args`) +around this for a few variables (`$_`, `$input`, `$MyInvocation`, `$PSBoundParameters`, and `$args`) by using the following method: 1. In the script, assign the value of the automatic variable to a new variable. diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md index e9640b524e7d..6bf1a10f1382 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md @@ -27,7 +27,7 @@ the full path. $newFile = $psISE.CurrentPowerShellTab.Files.Add() # Adds a file specified by its full path to the collection of files in the current PowerShell tab. -$psISE.CurrentPowerShellTab.Files.Add("$pshome\Examples\profile.ps1") +$psISE.CurrentPowerShellTab.Files.Add("$PSHOME\Examples\profile.ps1") ``` ### Remove\( File, \[Force\] \) diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md index e7f75d0ba5d0..7c79b1128686 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md @@ -25,7 +25,7 @@ The path and file name to a .snippets.ps1xml file that contains snippet definiti ```powershell # Loads a custom snippet file into the current PowerShell tab. -$SnipFile = Join-Path ( Split-Path $profile) 'Snippets\MySnips.snippets.ps1xml' $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath) +$SnipFile = Join-Path ( Split-Path $PROFILE) 'Snippets\MySnips.snippets.ps1xml' $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath) ``` ## See Also diff --git a/tests/Pester/Update-Help.Tests.ps1 b/tests/Pester/Update-Help.Tests.ps1 index 8c36bc6ad93a..3cc668323647 100644 --- a/tests/Pester/Update-Help.Tests.ps1 +++ b/tests/Pester/Update-Help.Tests.ps1 @@ -21,49 +21,49 @@ $testCases = @{ HelpFiles = "System.Management.Automation.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Core_00000000-0000-0000-0000-000000000000_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Core_00000000-0000-0000-0000-000000000000_en-US_HelpContent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } "Microsoft.PowerShell.Diagnostics" = @{ HelpFiles = "Microsoft.PowerShell.Commands.Diagnostics.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Diagnostics_ca046f10-ca64-4740-8ff9-2565dba61a4f_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Diagnostics_ca046f10-ca64-4740-8ff9-2565dba61a4f_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } "Microsoft.PowerShell.Host" = @{ HelpFiles = "Microsoft.PowerShell.ConsoleHost.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Host_56d66100-99a0-4ffc-a12d-eee9a6718aef_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Host_56d66100-99a0-4ffc-a12d-eee9a6718aef_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } "Microsoft.PowerShell.Management" = @{ HelpFiles = "Microsoft.PowerShell.Commands.Management.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Management_eefcb906-b326-4e99-9f54-8b4bb6ef3c6d_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Management_eefcb906-b326-4e99-9f54-8b4bb6ef3c6d_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } "Microsoft.PowerShell.Security" = @{ HelpFiles = "Microsoft.PowerShell.Security.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Security_a94c8c7e-9810-47c0-b8af-65089c13a35a_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Security_a94c8c7e-9810-47c0-b8af-65089c13a35a_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } "Microsoft.PowerShell.Utility" = @{ HelpFiles = "Microsoft.PowerShell.Commands.Utility.dll-Help.xml", "Microsoft.PowerShell.Utility-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Utility_1da87e53-152b-403e-98dc-74d7b4d63d59_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Utility_1da87e53-152b-403e-98dc-74d7b4d63d59_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } "Microsoft.WSMan.Management" = @{ HelpFiles = "Microsoft.WSMan.Management.dll-help.xml" HelpInfoFiles = "Microsoft.WsMan.Management_766204A6-330E-4263-A7AB-46C87AFC366C_HelpInfo.xml" CompressedFiles = "Microsoft.WsMan.Management_766204A6-330E-4263-A7AB-46C87AFC366C_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" } } @@ -74,7 +74,7 @@ if(($PSVersionTable.PSVersion.Major -ge 5) -and ($PSVersionTable.PSVersion.Minor HelpFiles = "Microsoft.Powershell.LocalAccounts.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.LocalAccounts_8e362604-2c0b-448f-a414-a6a690a644e2_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.LocalAccounts_8e362604-2c0b-448f-a414-a6a690a644e2_en-US_HelpContent$extension" - HelpInstallationPath = "$pshome\Modules\Microsoft.PowerShell.LocalAccounts\*\en-US" + HelpInstallationPath = "$PSHOME\Modules\Microsoft.PowerShell.LocalAccounts\*\en-US" } }