diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md index 6833fa0e61c..3ab4c3fb8d7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md @@ -1,7 +1,7 @@ --- description: Describes how to define constructors for PowerShell classes. Locale: en-US -ms.date: 11/13/2023 +ms.date: 10/22/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_constructors?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Constructors @@ -393,8 +393,11 @@ For classes that don't inherit from another class, the ordering is: For derived classes that inherit from another class, the ordering is: -1. The static constructor for the base class. -1. The static constructor for the derived class. +1. If the static constructor of the derived class doesn't depend on the base + class, the static constructor of the derived class is called first. +1. If the static constructor of the derived class depends on the base class, + the static constructor of the base class is called before executing the line + of code in the derived class that depends on base. 1. If the derived class constructor explicitly calls a base constructor overload, it runs that constructor for the base class. If it doesn't explicitly call a base constructor, it runs the default constructor for the diff --git a/reference/5.1/PSReadLine/About/about_PSReadLine_Functions.md b/reference/5.1/PSReadLine/About/about_PSReadLine_Functions.md index 6a645708d1a..06a4805ea65 100644 --- a/reference/5.1/PSReadLine/About/about_PSReadLine_Functions.md +++ b/reference/5.1/PSReadLine/About/about_PSReadLine_Functions.md @@ -3,7 +3,7 @@ description: > This article documents the functions provided by PSReadLine. These functions can be bound to keystrokes for easy access and invocation. Locale: en-US -ms.date: 10/10/2023 +ms.date: 06/17/2025 online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline_functions?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_PSReadLine_Functions @@ -980,8 +980,8 @@ pressing the `#` key sends 10 `#` characters (`##########`) to the input line. Similarly, you can use this with other operations, like `` or `Left-Arrow`. -- Windows mode: ``, ``, ``, ``, ``, ``, - ``, ``, ``, ``, `` +- Windows mode: ``, ``, ``, ``, ``, + ``, ``, ``, ``, ``, `` - Emacs mode: ``, ``, ``, ``, ``, ``, ``, ``, ``, ``, `` - Vi command mode: `<0>`, `<1>`, `<2>`, `<3>`, `<4>`, `<5>`, `<6>`, `<7>`, @@ -989,9 +989,11 @@ Similarly, you can use this with other operations, like `` or ### InvokePrompt -Erases the current prompt and calls the prompt function to redisplay the -prompt. Useful for custom key handlers that change state. For example, change -the current directory. +Attempts to erase the current prompt and call the prompt function to redisplay +the prompt. Useful for custom key handlers that change state. For example, +change the current directory. This method can't overwrite a prompt that has +left the screen buffer. Calls to `InvokePrompt` with no `Y` position argument +return immediately if the prompt can't be overwritten. - Function is unbound. diff --git a/reference/5.1/PSWorkflow/About/about_Workflows.md b/reference/5.1/PSWorkflow/About/about_Workflows.md index 29bb5e70170..4dafea84d68 100644 --- a/reference/5.1/PSWorkflow/About/about_Workflows.md +++ b/reference/5.1/PSWorkflow/About/about_Workflows.md @@ -16,13 +16,12 @@ Provides a brief introduction to the PowerShell Workflow feature. ## Long description PowerShell Workflow brings the benefits of the -[Windows Workflow Foundation](/dotnet/framework/windows-workflow-foundation) to -PowerShell and enables you to write and run workflows. +[Windows Workflow Foundation][05] to PowerShell and enables you to write and +run workflows. PowerShell Workflow was introduced in PowerShell 3.0 and the module is available up to PowerShell 5.1. For more information about PowerShell Workflow, -see the [Workflows Guide](/previous-versions/powershell/scripting/components/workflows-guide) -and [Writing a Windows PowerShell Workflow](/previous-versions/powershell/scripting/developer/workflow/writing-a-windows-powershell-workflow). +see the [Workflows Guide][07] and [Writing a Windows PowerShell Workflow][08]. ## About workflows @@ -34,7 +33,7 @@ environments. Workflows can be written in XAML, the language used in Windows Workflow Foundation, or in the PowerShell language. Workflows are typically packaged in modules and include help topics. For more information, see -[XAML Overview (WPF)](/dotnet/framework/wpf/advanced/xaml-overview-wpf). +[XAML Overview (WPF)][06]. Workflows are critical in an IT environment because they can survive reboots and recover automatically from common failures. You can disconnect and @@ -65,7 +64,7 @@ A PowerShell Workflow configuration consists of the following elements: The workflow session isn't required, but is recommended. **PSSessions** can take advantage of the robust recovery and Disconnected Sessions features of PowerShell to recover disconnected workflow sessions. For more information, see -[about_Remote_Disconnected_Sessions](../../Microsoft.PowerShell.Core/About/about_Remote_Disconnected_Sessions.md) +[about_Remote_Disconnected_Sessions][03] Because the client computer and the computer on which the workflow session runs can be managed nodes, you can run a workflow on a single computer that fulfills @@ -122,11 +121,9 @@ To run a workflow, use the following procedure. Enable-PSRemoting -Force ``` - You can enable remoting by using the **Turn on Script Execution** Group Policy - setting. For more information, see - [about_Group_Policy_Settings](../../Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md) - and - [about_Execution_Policies](../../Microsoft.PowerShell.Core/About/about_Execution_Policies.md). + You can enable remoting by using the **Turn on Script Execution** Group + Policy setting. For more information, see [about_Group_Policy_Settings][02] + and [about_Execution_Policies][01]. 1. Use the `New-PSWorkflowSession` or `New-PSSession` cmdlets to create the workflow session. @@ -136,8 +133,8 @@ To run a workflow, use the following procedure. computer. This session configuration includes scripts, type and formatting files, and options that are designed for workflows. - Or, use the `New-PSSession` cmdlet. Use the **ConfigurationName** parameter to - specify the **Microsoft.PowerShell.Workflow** session configuration. This + Or, use the `New-PSSession` cmdlet. Use the **ConfigurationName** parameter + to specify the **Microsoft.PowerShell.Workflow** session configuration. This command is the same as using the `New-PSWorkflowSession` cmdlet. An alternative is to use the `New-PSSession` cmdlet. Use the @@ -160,10 +157,10 @@ To run a workflow, use the following procedure. $ws = New-PSWorkflowSession @newPSWorkflowSessionSplat ``` - If you are an Administrator on the workflow session computer, you can use the - `New-PSWorkflowExecutionOption` cmdlet to create custom option settings for the - workflow session configuration. And, use the `Set-PSSessionConfiguration` - cmdlet to change the session configuration. + If you are an Administrator on the workflow session computer, you can use + the `New-PSWorkflowExecutionOption` cmdlet to create custom option settings + for the workflow session configuration. And, use the + `Set-PSSessionConfiguration` cmdlet to change the session configuration. ```powershell $newPSWorkflowExecutionOptionSplat = @{ @@ -204,13 +201,13 @@ To run a workflow, use the following procedure. ``` The following example runs the `Test-Workflow` on hundreds of computers. The - `Get-Content` cmdlet gets the computer names from a text file and saves them in - the `$Servers` variable on the local computer. + `Get-Content` cmdlet gets the computer names from a text file and saves them + in the `$Servers` variable on the local computer. `Invoke-Command` uses the `Using:` scope modifier to define the `$Servers` variable in the local session. For more information about the `Using:` scope modifier, see - [about_Remote_Variables](../../Microsoft.PowerShell.Core/About/about_Remote_Variables.md). + [about_Remote_Variables][04]. ```powershell $Servers = Get-Content Servers.txt @@ -291,12 +288,26 @@ Some workflow common parameters are unique to workflows, such as the **PSParameterCollection** parameter that lets you specify different workflow common parameter values for different remote nodes. For a list and description of the workflow common parameters, see -[about_WorkflowCommonParameters](about_WorkflowCommonParameters.md). +[about_WorkflowCommonParameters][09]. ## See also -- [Invoke-AsWorkflow](xref:PSWorkflowUtility.Invoke-AsWorkflow) -- [New-PSSession](xref:Microsoft.PowerShell.Core.New-PSSession) -- [PSWorkflow](xref:PSWorkflow) cmdlets -- [Workflows Guide](/previous-versions/powershell/scripting/components/workflows-guide) -- [Writing a Windows PowerShell Workflow](/previous-versions/powershell/scripting/developer/workflow/writing-a-windows-powershell-workflow) +- [Invoke-AsWorkflow][12] +- [New-PSSession][10] +- [PSWorkflow][11] cmdlets +- [Workflows Guide][07] +- [Writing a Windows PowerShell Workflow][08] + + +[01]: ../../Microsoft.PowerShell.Core/About/about_Execution_Policies.md +[02]: ../../Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +[03]: ../../Microsoft.PowerShell.Core/About/about_Remote_Disconnected_Sessions.md +[04]: ../../Microsoft.PowerShell.Core/About/about_Remote_Variables.md +[05]: /dotnet/framework/windows-workflow-foundation +[06]: /dotnet/desktop/wpf/xaml +[07]: /previous-versions/powershell/scripting/components/workflows-guide +[08]: /previous-versions/powershell/scripting/developer/workflow/writing-a-windows-powershell-workflow +[09]: about_WorkflowCommonParameters.md +[10]: xref:Microsoft.PowerShell.Core.New-PSSession +[11]: xref:PSWorkflow +[12]: xref:PSWorkflowUtility.Invoke-AsWorkflow diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md index 6ef41ffa916..140c94c3d20 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md @@ -1,7 +1,7 @@ --- description: Describes how to define constructors for PowerShell classes. Locale: en-US -ms.date: 10/13/2025 +ms.date: 10/22/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_constructors?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Constructors @@ -392,8 +392,11 @@ For classes that don't inherit from another class, the ordering is: For derived classes that inherit from another class, the ordering is: -1. The static constructor for the base class. -1. The static constructor for the derived class. +1. If the static constructor of the derived class doesn't depend on the base + class, the static constructor of the derived class is called first. +1. If the static constructor of the derived class depends on the base class, + the static constructor of the base class is called before executing the line + of code in the derived class that depends on base. 1. If the derived class constructor explicitly calls a base constructor overload, it runs that constructor for the base class. If it doesn't explicitly call a base constructor, it runs the default constructor for the diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md index 7d2594702ab..420f4dc6bdd 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md @@ -1,7 +1,7 @@ --- description: Describes how to define constructors for PowerShell classes. Locale: en-US -ms.date: 10/13/2025 +ms.date: 10/22/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_constructors?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Constructors @@ -392,8 +392,11 @@ For classes that don't inherit from another class, the ordering is: For derived classes that inherit from another class, the ordering is: -1. The static constructor for the base class. -1. The static constructor for the derived class. +1. If the static constructor of the derived class doesn't depend on the base + class, the static constructor of the derived class is called first. +1. If the static constructor of the derived class depends on the base class, + the static constructor of the base class is called before executing the line + of code in the derived class that depends on base. 1. If the derived class constructor explicitly calls a base constructor overload, it runs that constructor for the base class. If it doesn't explicitly call a base constructor, it runs the default constructor for the diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md index d15dc0bdf9f..6ae26971fc8 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Constructors.md @@ -1,7 +1,7 @@ --- description: Describes how to define constructors for PowerShell classes. Locale: en-US -ms.date: 10/13/2025 +ms.date: 10/22/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_constructors?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Constructors @@ -392,8 +392,11 @@ For classes that don't inherit from another class, the ordering is: For derived classes that inherit from another class, the ordering is: -1. The static constructor for the base class. -1. The static constructor for the derived class. +1. If the static constructor of the derived class doesn't depend on the base + class, the static constructor of the derived class is called first. +1. If the static constructor of the derived class depends on the base class, + the static constructor of the base class is called before executing the line + of code in the derived class that depends on base. 1. If the derived class constructor explicitly calls a base constructor overload, it runs that constructor for the base class. If it doesn't explicitly call a base constructor, it runs the default constructor for the diff --git a/reference/docs-conceptual/install/PowerShell-Support-Lifecycle.md b/reference/docs-conceptual/install/PowerShell-Support-Lifecycle.md index 3db37f0b4bc..d6bf48bd3fd 100644 --- a/reference/docs-conceptual/install/PowerShell-Support-Lifecycle.md +++ b/reference/docs-conceptual/install/PowerShell-Support-Lifecycle.md @@ -1,6 +1,6 @@ --- description: Details the policies governing support for PowerShell. -ms.date: 02/25/2025 +ms.date: 10/22/2025 ms.topic: lifecycle title: PowerShell Support Lifecycle --- @@ -15,7 +15,7 @@ PowerShell follows the [Microsoft Modern Lifecycle Policy][02]. Support dates fo [.NET Support Policy][06]. In this servicing approach, customers can choose Long Term Support (LTS) releases or current releases. -An **LTS** release of PowerShell is built on an **LTS** release of .NET. Updates to an **LTS** +An **LTS** release of PowerShell is an **LTS** release of .NET. Updates to an **LTS** release only contain critical security updates and servicing fixes that are designed to minimize impact on existing workloads. @@ -110,23 +110,23 @@ guarantees of responsiveness or fixes. The PowerShell support lifecycle follows the [support lifecycle of .NET][06]. The following table lists the end-of-support dates for the current versions of PowerShell: -| Version | Release Date | End-of-support | .NET Version | -| ------------------------ | :----------: | :------------: | ------------------------- | -| PowerShell 7.6 (preview) | Future date | Future date | Built on [.NET 9.0.0][14] | -| PowerShell 7.5 | 23-Jan-2025 | 12-May-2026 | Built on [.NET 9.0.0][14] | -| PowerShell 7.4 (LTS) | 16-Nov-2023 | 10-Nov-2026 | Built on [.NET 8.0.0][13] | +| Version | Release Date | End-of-support | .NET Version | +| ------------------------ | :----------: | :------------: | --------------- | +| PowerShell 7.6 (preview) | Future date | Future date | [.NET 10.0][19] | +| PowerShell 7.5 | 23-Jan-2025 | 12-May-2026 | [.NET 9.0][14] | +| PowerShell 7.4 (LTS) | 16-Nov-2023 | 10-Nov-2026 | [.NET 8.0][13] | The following table lists the end-of-support dates for retired versions of PowerShell: -| Version | Release Date | End-of-support | .NET Version | -| -------------------- | :----------: | :------------: | ---------------------------- | -| PowerShell 7.3 | 09-Nov-2022 | 08-May-2024 | Built on [.NET 7.0][12] | -| PowerShell 7.2 (LTS) | 08-Nov-2021 | 08-Nov-2024 | Built on [.NET 6.0][11] | -| PowerShell 7.1 | 11-Nov-2020 | 08-May-2022 | Built on [.NET 5.0][10] | -| PowerShell 7.0 (LTS) | 04-Mar-2020 | 03-Dec-2022 | Built on [.NET Core 3.1][09] | -| PowerShell 6.2 | 29-Mar-2019 | 04-Sep-2020 | Built on [.NET Core 2.1][08] | -| PowerShell 6.1 | 13-Sep-2018 | 28-Sep-2019 | Built on [.NET Core 2.1][08] | -| PowerShell 6.0 | 20-Jan-2018 | 13-Feb-2019 | Built on [.NET Core 2.0][07] | +| Version | Release Date | End-of-support | .NET Version | +| -------------------- | :----------: | :------------: | ------------------- | +| PowerShell 7.3 | 09-Nov-2022 | 08-May-2024 | [.NET 7.0][12] | +| PowerShell 7.2 (LTS) | 08-Nov-2021 | 08-Nov-2024 | [.NET 6.0][11] | +| PowerShell 7.1 | 11-Nov-2020 | 08-May-2022 | [.NET 5.0][10] | +| PowerShell 7.0 (LTS) | 04-Mar-2020 | 03-Dec-2022 | [.NET Core 3.1][09] | +| PowerShell 6.2 | 29-Mar-2019 | 04-Sep-2020 | [.NET Core 2.1][08] | +| PowerShell 6.1 | 13-Sep-2018 | 28-Sep-2019 | [.NET Core 2.1][08] | +| PowerShell 6.0 | 20-Jan-2018 | 13-Feb-2019 | [.NET Core 2.0][07] | ## Windows PowerShell release history @@ -168,3 +168,4 @@ you're running: [16]: https://github.com/PowerShell/PowerShell/issues/new/choose [17]: https://support.microsoft.com/contactus [18]: https://support.serviceshub.microsoft.com/ +[19]: https://github.com/dotnet/core/blob/main/release-notes/10.0/supported-os.md 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 756aeaf39f3..e4ddf78701b 100644 --- a/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md +++ b/reference/docs-conceptual/learn/deep-dives/everything-about-hashtable.md @@ -1,7 +1,7 @@ --- description: Hashtables are really important in PowerShell so it's good to have a solid understanding of them. ms.custom: contributor-KevinMarquette -ms.date: 06/25/2023 +ms.date: 10/22/2025 title: Everything you wanted to know about hashtables --- # Everything you wanted to know about hashtables @@ -269,6 +269,16 @@ $environments.Keys.Clone() | ForEach-Object { } ``` +> [!NOTE] +> You can't clone a hashtable containing a single key. PowerShell throws an error. Instead, you +> convert the **Keys** property to an array, then iterate over the array. + +```powershell +@($environments.Keys) | ForEach-Object { + $environments[$_] = 'SrvDev03' +} +``` + ## Hashtable as a collection of properties So far the type of objects we placed in our hashtable were all the same type of object. I used ages