From 02e450c52a5b0817b4d408fe091331c57008ec69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 08:04:33 -0500 Subject: [PATCH 1/4] Bump actions/checkout from 4 to 5 (#12290) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/checklist.yml | 2 +- .github/workflows/expectations.yml | 2 +- .github/workflows/stale-content.yml | 2 +- .github/workflows/targeting-repo-files.yml | 2 +- .github/workflows/targeting-valid-branch.yml | 2 +- .github/workflows/versioned-content.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checklist.yml b/.github/workflows/checklist.yml index 9b5000ecda2f..18ebdf965e41 100644 --- a/.github/workflows/checklist.yml +++ b/.github/workflows/checklist.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout Repository id: checkout_repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Verify Checklist id: verify_checklist uses: ./.github/actions/verification/checklist/v1 diff --git a/.github/workflows/expectations.yml b/.github/workflows/expectations.yml index 85407f1192c5..d99cdafda8ae 100644 --- a/.github/workflows/expectations.yml +++ b/.github/workflows/expectations.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout Repository id: checkout_repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Comment on Community PRs uses: ./.github/actions/commenting/expectations/v1 with: diff --git a/.github/workflows/stale-content.yml b/.github/workflows/stale-content.yml index b3558a54a204..d774e082e0f3 100644 --- a/.github/workflows/stale-content.yml +++ b/.github/workflows/stale-content.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout Repository id: checkout_repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Write Report uses: ./.github/actions/reporting/stale-content/v1 with: diff --git a/.github/workflows/targeting-repo-files.yml b/.github/workflows/targeting-repo-files.yml index 8d1315211cfd..3f181770cd47 100644 --- a/.github/workflows/targeting-repo-files.yml +++ b/.github/workflows/targeting-repo-files.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout Repository id: checkout_repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Authorized to Modify Repo Files? uses: ./.github/actions/verification/authorization/v1 with: diff --git a/.github/workflows/targeting-valid-branch.yml b/.github/workflows/targeting-valid-branch.yml index a84c1345f4e3..2a89dd1d0dcc 100644 --- a/.github/workflows/targeting-valid-branch.yml +++ b/.github/workflows/targeting-valid-branch.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout Repository id: checkout_repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Authorized to Target Live Branch? uses: ./.github/actions/verification/authorization/v1 with: diff --git a/.github/workflows/versioned-content.yml b/.github/workflows/versioned-content.yml index f3e092ebca7c..11b317cab4fc 100644 --- a/.github/workflows/versioned-content.yml +++ b/.github/workflows/versioned-content.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout Repository id: checkout_repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Write Report uses: ./.github/actions/reporting/versioned-content/v1 with: From 0d00dc38cc21c38b7fd6e2a5f166ac34bdb90f22 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 18 Aug 2025 08:34:48 -0700 Subject: [PATCH 2/4] Fixes #12272 - Update notes on PSRP changes (#12291) * Update notes on PSRP changes * Fix typos --- .../About/about_Remote_Requirements.md | 43 +++++++++++-------- .../security/security-features.md | 41 +++++++++++++++++- 2 files changed, 64 insertions(+), 20 deletions(-) diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Remote_Requirements.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Remote_Requirements.md index 2c07dddf7d17..aac25d1e5dc4 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Remote_Requirements.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Remote_Requirements.md @@ -1,7 +1,7 @@ --- description: Describes the system requirements and configuration requirements for running remote commands in PowerShell. Locale: en-US -ms.date: 07/03/2023 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_remote_requirements?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Remote_Requirements @@ -49,7 +49,7 @@ computers must have the following: - Windows Remote Management 2.0 To be fully supported, you should be using WMF 5.1. For more information about -WMF support, see [Windows Management Framework (WMF)][02]. +WMF support, see [Windows Management Framework (WMF)][03]. You can create a remote session between a computer running Windows PowerShell 2.0 and one running a newer version of PowerShell. However, features that run @@ -90,7 +90,7 @@ configurations with different security descriptors. Users can use the different endpoints. For more information about session configurations, see -[about_Session_Configurations][07]. +[about_Session_Configurations][08]. ## Windows network locations @@ -190,7 +190,11 @@ Id Name ComputerName State ConfigurationName 1 Session1 localhost Opened Microsoft.PowerShell ``` -If the command fails, see [about_Remote_Troubleshooting][04]. +If the command fails, see [about_Remote_Troubleshooting][05]. + +The PowerShell Remoting Protocol (PSRP) requires a secure transport layer for +secure data transfer. For more information, see _Secure data transfer in +PowerShell remoting_ section of [PowerShell security features][02]. ## Understand policies @@ -204,21 +208,22 @@ policies on the remote computer are in effect. ## See also -- [about_Remote][06] -- [about_Remote_Variables][05] -- [about_PSSessions][03] -- [Invoke-Command][09] -- [Enter-PSSession][08] -- [New-PSSession][10] +- [about_Remote][07] +- [about_Remote_Variables][06] +- [about_PSSessions][04] +- [Invoke-Command][10] +- [Enter-PSSession][09] +- [New-PSSession][11] [01]: /powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core -[02]: /powershell/scripting/windows-powershell/wmf/overview -[03]: about_PSSessions.md -[04]: about_Remote_Troubleshooting.md -[05]: about_Remote_Variables.md -[06]: about_Remote.md -[07]: about_Session_Configurations.md -[08]: xref:Microsoft.PowerShell.Core.Enter-PSSession -[09]: xref:Microsoft.PowerShell.Core.Invoke-Command -[10]: xref:Microsoft.PowerShell.Core.New-PSSession +[02]: /powershell/scripting/security/security-features#secure-data-transfer-in-powershell-remoting +[03]: /powershell/scripting/windows-powershell/wmf/overview +[04]: about_PSSessions.md +[05]: about_Remote_Troubleshooting.md +[06]: about_Remote_Variables.md +[07]: about_Remote.md +[08]: about_Session_Configurations.md +[09]: xref:Microsoft.PowerShell.Core.Enter-PSSession +[10]: xref:Microsoft.PowerShell.Core.Invoke-Command +[11]: xref:Microsoft.PowerShell.Core.New-PSSession diff --git a/reference/docs-conceptual/security/security-features.md b/reference/docs-conceptual/security/security-features.md index 550a28eaa55d..7dc199182945 100644 --- a/reference/docs-conceptual/security/security-features.md +++ b/reference/docs-conceptual/security/security-features.md @@ -1,6 +1,6 @@ --- description: PowerShell has several features designed to improve the security of your scripting environment. -ms.date: 05/22/2025 +ms.date: 08/18/2025 title: PowerShell security features --- # PowerShell security features @@ -92,6 +92,45 @@ The creation and publishing of the SBOM is the first step to modernize Federal G cybersecurity and enhance software supply chain security. For more information about this initiative, see the blog post [Generating SBOMs with SPDX at Microsoft][11]. +## Secure data transfer in PowerShell remoting + +Prior to PowerShell v7.6-preview5, a `Session_Key` is used to encrypt a **SecureString** before +sending it a PowerShell remote session. The PowerShell Remoting Protocol (PSRP) performs a +key exchange between client and server when a `SecureString` object needs to be +transferred. The exchange involves the following steps: + +1. The client side generates a public/private key pair and sends the public key to the server. +1. The server generates a session key for symmetric encryption. +1. The server uses the public key to encrypt the session key and sends it to the client. +1. Both the client and server use the new session key to encrypt a **SecureString** object. + +The PowerShell Remoting Protocol (PSRP) uses the `RSAEncryptionPadding.Pkcs1` algorithm during the +key exchange. The algorithm is **NOT** secure, so the key exchange doesn't provide any extra +security. + +> [!IMPORTANT] +> You must use a secure transport layer to ensure secure data transfer over PSRP. + +Beginning in PowerShell v7.6-preview5, the key exchange was deprecated. The version of PSRP was +incremented to v2.4 and includes the following changes: + +- The following PSRP messages are deprecated when both client and server are v2.4 or higher: + + - PUBLIC_KEY + - PUBLIC_KEY_REQUEST + - ENCRYPTED_SESSION_KEY + +- The encryption and decryption steps for `SecureString` are skipped when both client and server are + v2.4 or higher. + +This change is backward compatible. + +- For old clients or servers (v2.3 or lower), the key exchange is still used when needed. +- PSRP can use a named pipe remote sessions when both client and server are on the same machine. + Since it's possible for a remote client to connect to named pipe and the data is no longer + encrypted with a session key, the named pipe (used for `Enter-PSHostProcess`) rejects the remote + client. + ## Security Servicing Criteria PowerShell follows the [Microsoft Security Servicing Criteria for Windows][12]. Only security From d6e2d31afd4e3621cc78fb511ee03cf1c0bf2d1d Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 18 Aug 2025 11:49:57 -0700 Subject: [PATCH 3/4] Avoid unnecessary collection enumeration (#12292) --- .../script-authoring-considerations.md | 125 ++++++++++++------ 1 file changed, 85 insertions(+), 40 deletions(-) diff --git a/reference/docs-conceptual/dev-cross-plat/performance/script-authoring-considerations.md b/reference/docs-conceptual/dev-cross-plat/performance/script-authoring-considerations.md index 2e6895cd0421..acd8d042f50a 100644 --- a/reference/docs-conceptual/dev-cross-plat/performance/script-authoring-considerations.md +++ b/reference/docs-conceptual/dev-cross-plat/performance/script-authoring-considerations.md @@ -1,6 +1,6 @@ --- description: Scripting for Performance in PowerShell -ms.date: 12/05/2024 +ms.date: 08/18/2025 title: PowerShell scripting performance considerations --- @@ -116,7 +116,7 @@ $results >[!NOTE] > In PowerShell 7.5, array addition was optimized and no longer creates a new array for each > operation. The performance considerations described here still apply to PowerShell versions -> prior to 7.5. For more information, see [What's New in PowerShell 7.5][01]. +> prior to 7.5. For more information, see [What's New in PowerShell 7.5][02]. Array addition is inefficient because arrays have a fixed size. Each addition to the array creates a new array big enough to hold all elements of both the left and right operands. The elements of @@ -276,7 +276,7 @@ performance and memory consumption. There are at least two alternatives: -- The [`-join` operator][13] concatenates strings +- The [`-join` operator][07] concatenates strings - The .NET `[StringBuilder]` class provides a mutable string The following example compares the performance of these three methods of building a string. @@ -438,7 +438,7 @@ $Results = $Employees | ForEach-Object -Process { However, that implementation has to filter all 5000 items in the `$Accounts` collection once for every item in the `$Employee` collection. That can take minutes, even for this single-value lookup. -Instead, you can make a [Hash Table][02] that uses the shared **Name** property as a key and the +Instead, you can make a [Hash Table][01] that uses the shared **Name** property as a key and the matching account as the value. ```powershell @@ -632,6 +632,49 @@ Unwrapped = 42.92 ms The unwrapped example is **372 times faster**. Also, notice that the first implementation requires the **Append** parameter, which isn't required for the later implementation. +## Avoid unnecessary collection enumeration + +The [PowerShell comparison operators][05] have a convience feature when comparing collections. When +the left-hand value in the expression is a collection, the operator returns the elements of the +collection that match the right-hand value of the expression. + +This feature provides a simple way to filter a collection. For example: + +```powershell +PS> $Collection = 1..99 +PS> ($Collection -like '*1*') -join ' ' + +1 10 11 12 13 14 15 16 17 18 19 21 31 41 51 61 71 81 91 +``` + +However, when you use a collection comparison in a conditional statement that only expects a +[boolean][04] result, this feature can result in poor performance. + +Take for example: + +```powershell +if ($Collection -like '*1*') { 'Found' } +``` + +In this example, PowerShell compares the right-hand value to every value in the collection and +returns a collection of results. Since the result isn't empty, the non-null result evaluates as +`$true`. The condition is true when the first match is found, but PowerShell still enumerates the +entire collection. This enumeration can have a significant performance impact for large collections. + +One way to improve performance is to use the [`Where()`][03] method of the collection. The `Where()` +method stops evaluating the collection after it finds the first match. + +```powershell +# Create an array of 1048576 items +$Collection = foreach ($x in 1..1MB) { $x } +(Measure-Command { if ($Collection -like '*1*') { 'Found' } }).TotalMilliseconds +633.3695 +(Measure-Command { if ($Collection.Where({ $_ -like '*1*' }, 'first')) { 'Found' } }).TotalMilliseconds +2.607 +``` + +For a million items, using the `Where()` method is significantly faster. + ## Object creation Creating objects using the `New-Object` cmdlet can be slow. The following code compares the @@ -701,7 +744,7 @@ perhaps most commonly used way to create a new **PSObject** and then add new pro negligible however it can become very noticeable for big collections. In that case, the recommended approach is to use an `[OrderedDictionary]` and then convert it to a **PSObject** using the `[pscustomobject]` type accelerator. For more information, see the _Creating ordered dictionaries_ -section of [about_Hash_Tables][19]. +section of [about_Hash_Tables][06]. Assume you have the following API response stored in the variable `$json`. @@ -868,39 +911,41 @@ Iterations Test TotalMilliseconds RelativeSpeed ## Related links -- [`$null`][03] -- [`[void]`][04] -- [Out-Null][05] -- [`List`][06] -- [`Add(T)` method][07] -- [`[string]`][08] -- [`[int]`][09] -- [`[Object]`][10] -- [`ToArray()` method][11] -- [`[ArrayList]`][12] -- [`[StringBuilder]`][14] -- [`[StreamReader]`][15] -- [`[File]::ReadLines()` method][16] -- [Write-Host][17] -- [Add-Member][18] - - -[01]: ../../whats-new/what-s-new-in-powershell-75.md#engine-improvements -[02]: ../../learn/deep-dives/everything-about-hashtable.md -[03]: ../../learn/deep-dives/everything-about-null.md -[04]: xref:System.Void -[05]: xref:Microsoft.PowerShell.Core.Out-Null -[06]: xref:System.Collections.Generic.List`1 -[07]: xref:System.Collections.Generic.List`1.Add%2A -[08]: xref:System.String -[09]: xref:System.Int32 -[10]: xref:System.Object -[11]: xref:System.Collections.Generic.List%601.ToArray%2A#system-collections-generic-list-1-toarray -[12]: xref:System.Collections.ArrayList -[13]: /powershell/module/microsoft.powershell.core/about/about_join -[14]: xref:System.Text.StringBuilder -[15]: xref:System.IO.StreamReader +- [`$null`][01] +- [System.Void][21] +- [Out-Null][08] +- [List\][13] +- [Add(T) method][14] +- [System.String][19] +- [System.Int32][15] +- [System.Object][18] +- [ToArray() method][12] +- [System.Collections.ArrayList][11] +- [System.Text.StringBuilder][20] +- [System.IO.StreamReader][17] +- [File::ReadLines() method][16] +- [Write-Host][10] +- [Add-Member][09] + + +[01]: ../../learn/deep-dives/everything-about-hashtable.md +[02]: ../../whats-new/what-s-new-in-powershell-75.md#engine-improvements +[03]: /powershell/module/microsoft.powershell.core/about/about_arrays#where +[04]: /powershell/module/microsoft.powershell.core/about/about_booleans +[05]: /powershell/module/microsoft.powershell.core/about/about_comparison_operators +[06]: /powershell/module/microsoft.powershell.core/about/about_hash_tables#creating-ordered-dictionaries +[07]: /powershell/module/microsoft.powershell.core/about/about_join +[08]: xref:Microsoft.PowerShell.Core.Out-Null +[09]: xref:Microsoft.PowerShell.Utility.Add-Member +[10]: xref:Microsoft.PowerShell.Utility.Write-Host +[11]: xref:System.Collections.ArrayList +[12]: xref:System.Collections.Generic.List%601.ToArray%2A#system-collections-generic-list-1-toarray +[13]: xref:System.Collections.Generic.List`1 +[14]: xref:System.Collections.Generic.List`1.Add%2A +[15]: xref:System.Int32 [16]: xref:System.IO.File.ReadLines%2A -[17]: xref:Microsoft.PowerShell.Utility.Write-Host -[18]: xref:Microsoft.PowerShell.Utility.Add-Member -[19]: /powershell/module/microsoft.powershell.core/about/about_hash_tables#creating-ordered-dictionaries +[17]: xref:System.IO.StreamReader +[18]: xref:System.Object +[19]: xref:System.String +[20]: xref:System.Text.StringBuilder +[21]: xref:System.Void From b5df2e3458f71c9c21b896b72765e67377b7ca0b Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 18 Aug 2025 13:49:22 -0700 Subject: [PATCH 4/4] Update release notes for PSReadLine (#12293) --- .../5.1/PSReadLine/About/about_PSReadLine.md | 9 ++++-- .../About/about_PSReadLine_Release_Notes.md | 32 +++++++++++++++++-- .../7.4/PSReadLine/About/about_PSReadLine.md | 17 ++++++---- .../About/about_PSReadLine_Release_Notes.md | 32 +++++++++++++++++-- reference/7.4/PSReadLine/PSReadLine.md | 5 +-- .../7.5/PSReadLine/About/about_PSReadLine.md | 17 ++++++---- .../About/about_PSReadLine_Release_Notes.md | 32 +++++++++++++++++-- reference/7.5/PSReadLine/PSReadLine.md | 5 +-- .../7.6/PSReadLine/About/about_PSReadLine.md | 17 ++++++---- .../About/about_PSReadLine_Release_Notes.md | 32 +++++++++++++++++-- reference/7.6/PSReadLine/PSReadLine.md | 5 +-- 11 files changed, 164 insertions(+), 39 deletions(-) diff --git a/reference/5.1/PSReadLine/About/about_PSReadLine.md b/reference/5.1/PSReadLine/About/about_PSReadLine.md index 1aef42894a94..7d5d21bf70ef 100644 --- a/reference/5.1/PSReadLine/About/about_PSReadLine.md +++ b/reference/5.1/PSReadLine/About/about_PSReadLine.md @@ -1,7 +1,7 @@ --- description: PSReadLine provides an improved command-line editing experience in the PowerShell console. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine @@ -124,8 +124,11 @@ APIs are documented in [about_PSReadLine_Functions][02]. ### Command History 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 +entered from the command line. The history file is a file named +`$($Host.Name)_history.txt`, which results in a unique file for each host. For +example, the history file for the PowerShell Extension console in Visual Studio +Code is `Visual Studio Code Host_history.txt`. +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/About/about_PSReadLine_Release_Notes.md b/reference/5.1/PSReadLine/About/about_PSReadLine_Release_Notes.md index 0bccf9eeda2a..64f98d46c281 100644 --- a/reference/5.1/PSReadLine/About/about_PSReadLine_Release_Notes.md +++ b/reference/5.1/PSReadLine/About/about_PSReadLine_Release_Notes.md @@ -1,7 +1,7 @@ --- description: This article contains the list of changes for each released version of PSReadLine. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline_release_notes?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine_Release_Notes @@ -19,7 +19,7 @@ changes, see the **PSReadLine** [ChangeLog][01]. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. -- v2.3.6 shipped in PowerShell 7.5.0 +- v2.3.6 shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 shipped in PowerShell 7.4.0-rc.1 - v2.2.6 shipped in PowerShell 7.3.0 @@ -29,7 +29,33 @@ Windows PowerShell 5.1. ## Release Notes -### v2.4.0-beta1 - 2025-02-28 +### v2.4.3-beta3 - 2025-07-23 + +You can get the v2.4.3-beta3 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Allow accepting the current input automatically from within an OnIdle event + handler +- Add VS Code tasks and debug config +- Add bound check for the cursor top value to InvokePrompt +- Fix typo in SamplePSReadLineProfile.ps1 +- Fix line ending and cache some reflection operations +- Improve test reliability by making sure the PSReadLine one-time + initialization is done + +### v2.4.2-beta2 - 2025-04-16 + +You can get the v2.4.2-beta2 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Add a private field to indicate if PSReadLine is initialized and ready +- Use CFS for installing module and deploy box for module publish + +### v2.4.1-beta1 - 2025-02-28 - Avoid querying for cursor position when it's not necessary - Handle buffer changes made by an event handler diff --git a/reference/7.4/PSReadLine/About/about_PSReadLine.md b/reference/7.4/PSReadLine/About/about_PSReadLine.md index 84b0bf70d375..7e84840b4bd2 100644 --- a/reference/7.4/PSReadLine/About/about_PSReadLine.md +++ b/reference/7.4/PSReadLine/About/about_PSReadLine.md @@ -1,7 +1,7 @@ --- description: PSReadLine provides an improved command-line editing experience in the PowerShell console. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine @@ -159,11 +159,16 @@ APIs are documented in [about_PSReadLine_Functions][02]. ### Command History 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 -`$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`. +entered from the command line. The history file is a file named +`$($Host.Name)_history.txt`, which results in a unique file for each host. For +example, the history file for the PowerShell Extension console in Visual Studio +Code is `Visual Studio Code Host_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`. The history can contain sensitive data including passwords. PSReadLine attempts to filter out sensitive information. Any command lines containing the following diff --git a/reference/7.4/PSReadLine/About/about_PSReadLine_Release_Notes.md b/reference/7.4/PSReadLine/About/about_PSReadLine_Release_Notes.md index c010596e41a9..85713b4f0cbc 100644 --- a/reference/7.4/PSReadLine/About/about_PSReadLine_Release_Notes.md +++ b/reference/7.4/PSReadLine/About/about_PSReadLine_Release_Notes.md @@ -1,7 +1,7 @@ --- description: This article contains the list of changes for each released version of PSReadLine. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline_release_notes?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine_Release_Notes @@ -19,7 +19,7 @@ changes, see the **PSReadLine** [ChangeLog][01]. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. -- v2.3.6 shipped in PowerShell 7.5.0 +- v2.3.6 shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 shipped in PowerShell 7.4.0-rc.1 - v2.2.6 shipped in PowerShell 7.3.0 @@ -29,7 +29,33 @@ Windows PowerShell 5.1. ## Release Notes -### v2.4.0-beta1 - 2025-02-28 +### v2.4.3-beta3 - 2025-07-23 + +You can get the v2.4.3-beta3 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Allow accepting the current input automatically from within an OnIdle event + handler +- Add VS Code tasks and debug config +- Add bound check for the cursor top value to InvokePrompt +- Fix typo in SamplePSReadLineProfile.ps1 +- Fix line ending and cache some reflection operations +- Improve test reliability by making sure the PSReadLine one-time + initialization is done + +### v2.4.2-beta2 - 2025-04-16 + +You can get the v2.4.2-beta2 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Add a private field to indicate if PSReadLine is initialized and ready +- Use CFS for installing module and deploy box for module publish + +### v2.4.1-beta1 - 2025-02-28 - Avoid querying for cursor position when it's not necessary - Handle buffer changes made by an event handler diff --git a/reference/7.4/PSReadLine/PSReadLine.md b/reference/7.4/PSReadLine/PSReadLine.md index aa11bf5ab721..a25804a8221c 100644 --- a/reference/7.4/PSReadLine/PSReadLine.md +++ b/reference/7.4/PSReadLine/PSReadLine.md @@ -4,7 +4,7 @@ Help Version: 7.4.0.0 Locale: en-US Module Guid: 5714753b-2afd-4492-a5fd-01d9e2cff8b5 Module Name: PSReadLine -ms.date: 09/17/2024 +ms.date: 08/18/2025 schema: 2.0.0 title: PSReadLine --- @@ -18,6 +18,7 @@ editing environment in PowerShell. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. +- v2.3.6 first shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 first shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 first shipped in PowerShell 7.4.0-rc.1 - v2.2.6 first shipped in PowerShell 7.3.0 @@ -28,7 +29,7 @@ Windows PowerShell 5.1. For more information about version differences, see [about_PSReadLine_Release_Notes](about/about_PSReadLine_Release_Notes.md). -These articles document version 2.3.5 of PSReadLine. +These articles document version 2.3.6 of PSReadLine. > [!NOTE] > Beginning with PowerShell 7.0, PowerShell skips auto-loading PSReadLine on diff --git a/reference/7.5/PSReadLine/About/about_PSReadLine.md b/reference/7.5/PSReadLine/About/about_PSReadLine.md index 12d0e9c58f2f..237e1528d91a 100644 --- a/reference/7.5/PSReadLine/About/about_PSReadLine.md +++ b/reference/7.5/PSReadLine/About/about_PSReadLine.md @@ -1,7 +1,7 @@ --- description: PSReadLine provides an improved command-line editing experience in the PowerShell console. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine @@ -159,11 +159,16 @@ APIs are documented in [about_PSReadLine_Functions][02]. ### Command History 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 -`$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`. +entered from the command line. The history file is a file named +`$($Host.Name)_history.txt`, which results in a unique file for each host. For +example, the history file for the PowerShell Extension console in Visual Studio +Code is `Visual Studio Code Host_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`. The history can contain sensitive data including passwords. PSReadLine attempts to filter out sensitive information. Any command lines containing the following diff --git a/reference/7.5/PSReadLine/About/about_PSReadLine_Release_Notes.md b/reference/7.5/PSReadLine/About/about_PSReadLine_Release_Notes.md index 58196ac12757..3be2a0964f81 100644 --- a/reference/7.5/PSReadLine/About/about_PSReadLine_Release_Notes.md +++ b/reference/7.5/PSReadLine/About/about_PSReadLine_Release_Notes.md @@ -1,7 +1,7 @@ --- description: This article contains the list of changes for each released version of PSReadLine. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline_release_notes?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine_Release_Notes @@ -19,7 +19,7 @@ changes, see the **PSReadLine** [ChangeLog][01]. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. -- v2.3.6 shipped in PowerShell 7.5.0 +- v2.3.6 shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 shipped in PowerShell 7.4.0-rc.1 - v2.2.6 shipped in PowerShell 7.3.0 @@ -29,7 +29,33 @@ Windows PowerShell 5.1. ## Release Notes -### v2.4.0-beta1 - 2025-02-28 +### v2.4.3-beta3 - 2025-07-23 + +You can get the v2.4.3-beta3 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Allow accepting the current input automatically from within an OnIdle event + handler +- Add VS Code tasks and debug config +- Add bound check for the cursor top value to InvokePrompt +- Fix typo in SamplePSReadLineProfile.ps1 +- Fix line ending and cache some reflection operations +- Improve test reliability by making sure the PSReadLine one-time + initialization is done + +### v2.4.2-beta2 - 2025-04-16 + +You can get the v2.4.2-beta2 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Add a private field to indicate if PSReadLine is initialized and ready +- Use CFS for installing module and deploy box for module publish + +### v2.4.1-beta1 - 2025-02-28 - Avoid querying for cursor position when it's not necessary - Handle buffer changes made by an event handler diff --git a/reference/7.5/PSReadLine/PSReadLine.md b/reference/7.5/PSReadLine/PSReadLine.md index 7c4c046a71e6..87603ec3667b 100644 --- a/reference/7.5/PSReadLine/PSReadLine.md +++ b/reference/7.5/PSReadLine/PSReadLine.md @@ -4,7 +4,7 @@ Help Version: 7.5.0.0 Locale: en-US Module Guid: 5714753b-2afd-4492-a5fd-01d9e2cff8b5 Module Name: PSReadLine -ms.date: 09/17/2024 +ms.date: 08/18/2025 schema: 2.0.0 title: PSReadLine --- @@ -18,6 +18,7 @@ editing environment in PowerShell. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. +- v2.3.6 first shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 first shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 first shipped in PowerShell 7.4.0-rc.1 - v2.2.6 first shipped in PowerShell 7.3.0 @@ -28,7 +29,7 @@ Windows PowerShell 5.1. For more information about version differences, see [about_PSReadLine_Release_Notes](about/about_PSReadLine_Release_Notes.md). -These articles document version 2.3.5 of PSReadLine. +These articles document version 2.3.6 of PSReadLine. > [!NOTE] > Beginning with PowerShell 7.0, PowerShell skips auto-loading PSReadLine on diff --git a/reference/7.6/PSReadLine/About/about_PSReadLine.md b/reference/7.6/PSReadLine/About/about_PSReadLine.md index 6f61a16920e6..66c41b2e9929 100644 --- a/reference/7.6/PSReadLine/About/about_PSReadLine.md +++ b/reference/7.6/PSReadLine/About/about_PSReadLine.md @@ -1,7 +1,7 @@ --- description: PSReadLine provides an improved command-line editing experience in the PowerShell console. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine @@ -159,11 +159,16 @@ APIs are documented in [about_PSReadLine_Functions][02]. ### Command History 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 -`$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`. +entered from the command line. The history file is a file named +`$($Host.Name)_history.txt`, which results in a unique file for each host. For +example, the history file for the PowerShell Extension console in Visual Studio +Code is `Visual Studio Code Host_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`. The history can contain sensitive data including passwords. PSReadLine attempts to filter out sensitive information. Any command lines containing the following diff --git a/reference/7.6/PSReadLine/About/about_PSReadLine_Release_Notes.md b/reference/7.6/PSReadLine/About/about_PSReadLine_Release_Notes.md index 58de1272cb83..3ac3f1b2bdca 100644 --- a/reference/7.6/PSReadLine/About/about_PSReadLine_Release_Notes.md +++ b/reference/7.6/PSReadLine/About/about_PSReadLine_Release_Notes.md @@ -1,7 +1,7 @@ --- description: This article contains the list of changes for each released version of PSReadLine. Locale: en-US -ms.date: 03/03/2025 +ms.date: 08/18/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline_release_notes?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine_Release_Notes @@ -19,7 +19,7 @@ changes, see the **PSReadLine** [ChangeLog][01]. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. -- v2.3.6 shipped in PowerShell 7.5.0 +- v2.3.6 shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 shipped in PowerShell 7.4.0-rc.1 - v2.2.6 shipped in PowerShell 7.3.0 @@ -29,7 +29,33 @@ Windows PowerShell 5.1. ## Release Notes -### v2.4.0-beta1 - 2025-02-28 +### v2.4.3-beta3 - 2025-07-23 + +You can get the v2.4.3-beta3 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Allow accepting the current input automatically from within an OnIdle event + handler +- Add VS Code tasks and debug config +- Add bound check for the cursor top value to InvokePrompt +- Fix typo in SamplePSReadLineProfile.ps1 +- Fix line ending and cache some reflection operations +- Improve test reliability by making sure the PSReadLine one-time + initialization is done + +### v2.4.2-beta2 - 2025-04-16 + +You can get the v2.4.2-beta2 version of the PSReadLine module from PowerShell +Gallery. + +This release includes the following changes: + +- Add a private field to indicate if PSReadLine is initialized and ready +- Use CFS for installing module and deploy box for module publish + +### v2.4.1-beta1 - 2025-02-28 - Avoid querying for cursor position when it's not necessary - Handle buffer changes made by an event handler diff --git a/reference/7.6/PSReadLine/PSReadLine.md b/reference/7.6/PSReadLine/PSReadLine.md index bbd074b1787f..cb4400f93fdc 100644 --- a/reference/7.6/PSReadLine/PSReadLine.md +++ b/reference/7.6/PSReadLine/PSReadLine.md @@ -4,7 +4,7 @@ Help Version: 7.6.0.0 Locale: en-US Module Guid: 5714753b-2afd-4492-a5fd-01d9e2cff8b5 Module Name: PSReadLine -ms.date: 09/17/2024 +ms.date: 08/18/2025 schema: 2.0.0 title: PSReadLine --- @@ -18,6 +18,7 @@ editing environment in PowerShell. There have been many updates to PSReadLine since the version that ships in Windows PowerShell 5.1. +- v2.3.6 first shipped in PowerShell 7.4.7 and 7.5.0 - v2.3.5 first shipped in PowerShell 7.4.2 and 7.5.0-preview.3 - v2.3.4 first shipped in PowerShell 7.4.0-rc.1 - v2.2.6 first shipped in PowerShell 7.3.0 @@ -28,7 +29,7 @@ Windows PowerShell 5.1. For more information about version differences, see [about_PSReadLine_Release_Notes](about/about_PSReadLine_Release_Notes.md). -These articles document version 2.3.5 of PSReadLine. +These articles document version 2.3.6 of PSReadLine. > [!NOTE] > Beginning with PowerShell 7.0, PowerShell skips auto-loading PSReadLine on