diff --git a/reference/docs-conceptual/lang-spec/chapter-01.md b/reference/docs-conceptual/lang-spec/chapter-01.md index 7b041e5fc829..3c7ac980bdeb 100644 --- a/reference/docs-conceptual/lang-spec/chapter-01.md +++ b/reference/docs-conceptual/lang-spec/chapter-01.md @@ -1,23 +1,11 @@ --- description: This Language Specification describe the syntax, semantics, and behavior of the PowerShell language. -ms.date: 05/19/2021 +ms.date: 01/08/2025 title: Windows PowerShell Language Specification 3.0 --- # Windows PowerShell Language Specification 3.0 -The _Windows PowerShell Language Specification 3.0_ was published in December 2012 and is based on -PowerShell 3.0. The specification document is available as a Microsoft Word document from the -Microsoft Download Center at: -[https://www.microsoft.com/download/details.aspx?id=36389](https://www.microsoft.com/download/details.aspx?id=36389) - -That Word document has been converted for presentation here on Microsoft Learn. During conversion, -some editorial changes have been made to accommodate formatting for the Docs platform. Some typos -and minor errors have been corrected. - -> [!IMPORTANT] -> The contents of this documentation may not reflect the current state of PowerShell in its current -> version. There is no plan to update this documentation to reflect the current state. This -> documentation is presented here for historical reference. +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] ## 1. Introduction diff --git a/reference/docs-conceptual/lang-spec/chapter-02.md b/reference/docs-conceptual/lang-spec/chapter-02.md index bb838367d1db..869a3ce53eb6 100644 --- a/reference/docs-conceptual/lang-spec/chapter-02.md +++ b/reference/docs-conceptual/lang-spec/chapter-02.md @@ -5,6 +5,8 @@ title: Lexical structure --- # 2. Lexical Structure +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + ## 2.1 Grammars This specification shows the syntax of the PowerShell language using two grammars. The _lexical diff --git a/reference/docs-conceptual/lang-spec/chapter-03.md b/reference/docs-conceptual/lang-spec/chapter-03.md index 91b37c1a27bd..55318dc1f0de 100644 --- a/reference/docs-conceptual/lang-spec/chapter-03.md +++ b/reference/docs-conceptual/lang-spec/chapter-03.md @@ -5,6 +5,8 @@ title: Basic concepts --- # 3. Basic concepts +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + ## 3.1 Providers and drives A *provider* allows access to data and components that would not otherwise be easily accessible at diff --git a/reference/docs-conceptual/lang-spec/chapter-04.md b/reference/docs-conceptual/lang-spec/chapter-04.md index d1f44c2b5cf0..3991ecc3f294 100644 --- a/reference/docs-conceptual/lang-spec/chapter-04.md +++ b/reference/docs-conceptual/lang-spec/chapter-04.md @@ -5,14 +5,16 @@ title: Types --- # 4. Types -In PowerShell, each value has a type, and types fall into one of two main categories: **value types** -and **reference types**. Consider the type `int`, which is typical of value types. A value of type -`int` is completely self-contained; all the bits needed to represent that value are stored in that -value, and every bit pattern in that value represents a valid value for its type. Now, consider the -array type `int[]`, which is typical of reference types. A so-called value of an array type can hold -either a reference to an object that actually contains the array elements, or the **null reference** -whose value is `$null`. The important distinction between the two type categories is best -demonstrated by the differences in their semantics during assignment. For example, +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + +In PowerShell, each value has a type, and types fall into one of two main categories: **value +types** and **reference types**. Consider the type `int`, which is typical of value types. A value +of type `int` is completely self-contained; all the bits needed to represent that value are stored +in that value, and every bit pattern in that value represents a valid value for its type. Now, +consider the array type `int[]`, which is typical of reference types. A so-called value of an array +type can hold either a reference to an object that actually contains the array elements, or the +**null reference** whose value is `$null`. The important distinction between the two type categories +is best demonstrated by the differences in their semantics during assignment. For example, ```powershell $i = 100 # $i designates an int value 100 diff --git a/reference/docs-conceptual/lang-spec/chapter-05.md b/reference/docs-conceptual/lang-spec/chapter-05.md index 2d65d60d4b3e..24fe4d6d4300 100644 --- a/reference/docs-conceptual/lang-spec/chapter-05.md +++ b/reference/docs-conceptual/lang-spec/chapter-05.md @@ -5,6 +5,8 @@ title: Variables --- # 5. Variables +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + A variable represents a storage location for a value, and that value has a type. Traditional procedural programming languages are statically typed; that is, the runtime type of a variable is that with which it was declared at compile time. Object-oriented languages add the idea of diff --git a/reference/docs-conceptual/lang-spec/chapter-06.md b/reference/docs-conceptual/lang-spec/chapter-06.md index e36997f21a0d..3348a9c809f9 100644 --- a/reference/docs-conceptual/lang-spec/chapter-06.md +++ b/reference/docs-conceptual/lang-spec/chapter-06.md @@ -5,6 +5,8 @@ title: Conversions --- # 6. Conversions +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + A *type conversion* is performed when a value of one type is used in a context that requires a different type. If such a conversion happens automatically it is known as *implicit conversion*. (A common example of this is with some operators that need to convert one or more of the values diff --git a/reference/docs-conceptual/lang-spec/chapter-07.md b/reference/docs-conceptual/lang-spec/chapter-07.md index 482d9929ff54..41a8dd230aeb 100644 --- a/reference/docs-conceptual/lang-spec/chapter-07.md +++ b/reference/docs-conceptual/lang-spec/chapter-07.md @@ -5,6 +5,8 @@ title: Expressions --- # 7. Expressions +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + Syntax: ```Syntax diff --git a/reference/docs-conceptual/lang-spec/chapter-08.md b/reference/docs-conceptual/lang-spec/chapter-08.md index ff022ae22bdd..2034451860c9 100644 --- a/reference/docs-conceptual/lang-spec/chapter-08.md +++ b/reference/docs-conceptual/lang-spec/chapter-08.md @@ -5,6 +5,8 @@ title: Statements --- # 8. Statements +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + ## 8.1 Statement blocks and lists Syntax: diff --git a/reference/docs-conceptual/lang-spec/chapter-09.md b/reference/docs-conceptual/lang-spec/chapter-09.md index ab996b5bad85..35e0ff9ec221 100644 --- a/reference/docs-conceptual/lang-spec/chapter-09.md +++ b/reference/docs-conceptual/lang-spec/chapter-09.md @@ -5,6 +5,8 @@ title: Arrays --- # 9. Arrays +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + ## 9.1 Introduction PowerShell supports arrays of one or more dimensions with each dimension having zero or more diff --git a/reference/docs-conceptual/lang-spec/chapter-10.md b/reference/docs-conceptual/lang-spec/chapter-10.md index e3fbf948851b..bf04d3284dd8 100644 --- a/reference/docs-conceptual/lang-spec/chapter-10.md +++ b/reference/docs-conceptual/lang-spec/chapter-10.md @@ -5,6 +5,8 @@ title: Hashtables --- # 10. Hashtables +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + Syntax: > [!TIP] diff --git a/reference/docs-conceptual/lang-spec/chapter-11.md b/reference/docs-conceptual/lang-spec/chapter-11.md index d6a63acaad4a..a1eb3802a708 100644 --- a/reference/docs-conceptual/lang-spec/chapter-11.md +++ b/reference/docs-conceptual/lang-spec/chapter-11.md @@ -5,6 +5,8 @@ title: Modules --- # 11. Modules +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + ## 11.1 Introduction As stated in [§3.14][§3.14], a module is a self-contained reusable unit that allows PowerShell code to be diff --git a/reference/docs-conceptual/lang-spec/chapter-12.md b/reference/docs-conceptual/lang-spec/chapter-12.md index 36dafd97f99c..13cdc3c64169 100644 --- a/reference/docs-conceptual/lang-spec/chapter-12.md +++ b/reference/docs-conceptual/lang-spec/chapter-12.md @@ -5,6 +5,8 @@ title: Attributes --- # 12. Attributes +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + An *attribute* object associates predefined system information with a *target element*, which can be a param block or a parameter ([§8.10][§8.10]). Each attribute object has an *attribute type*. diff --git a/reference/docs-conceptual/lang-spec/chapter-13.md b/reference/docs-conceptual/lang-spec/chapter-13.md index 8ff300d4a1ff..b5d08b24aa20 100644 --- a/reference/docs-conceptual/lang-spec/chapter-13.md +++ b/reference/docs-conceptual/lang-spec/chapter-13.md @@ -5,6 +5,8 @@ title: Cmdlets --- # 13. Cmdlets +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + A cmdlet is a single-feature command that manipulates objects in PowerShell. Cmdlets can be recognized by their name format, a verb and noun separated by a dash (`-`), such as `Get-Help`, `Get-Process`, and `Start-Service`. A *verb pattern* is a verb expressed using wildcards, as diff --git a/reference/docs-conceptual/lang-spec/chapter-14.md b/reference/docs-conceptual/lang-spec/chapter-14.md index 3b6fc1f8b3b7..d9bf6163f916 100644 --- a/reference/docs-conceptual/lang-spec/chapter-14.md +++ b/reference/docs-conceptual/lang-spec/chapter-14.md @@ -6,6 +6,8 @@ title: Comment-Based Help # A. Comment-Based Help +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + PowerShell provides a mechanism for programmers to document their scripts using special comment directives. Comments using such syntax are called *help comments*. The cmdlet [Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) generates documentation from these directives. diff --git a/reference/docs-conceptual/lang-spec/chapter-15.md b/reference/docs-conceptual/lang-spec/chapter-15.md index 278e515b770e..b9d7d0854413 100644 --- a/reference/docs-conceptual/lang-spec/chapter-15.md +++ b/reference/docs-conceptual/lang-spec/chapter-15.md @@ -5,6 +5,8 @@ title: Appendix A - Grammar --- # B. Grammar +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + This appendix contains summaries of the lexical and syntactic grammars found in the main document. > [!TIP] diff --git a/reference/docs-conceptual/lang-spec/chapter-16.md b/reference/docs-conceptual/lang-spec/chapter-16.md index 88da5a8d34bc..89752423ce7e 100644 --- a/reference/docs-conceptual/lang-spec/chapter-16.md +++ b/reference/docs-conceptual/lang-spec/chapter-16.md @@ -5,6 +5,8 @@ title: Appendix B - References --- # C. References +[!INCLUDE [Disclaimer](../../includes/language-spec.md)] + ANSI/IEEE 754−2008, _Binary floating-point arithmetic for microprocessor systems_. ECMA-334, _C# Language Specification_, 4th edition (June 2006), diff --git a/reference/includes/language-spec.md b/reference/includes/language-spec.md new file mode 100644 index 000000000000..45e65f8fab03 --- /dev/null +++ b/reference/includes/language-spec.md @@ -0,0 +1,23 @@ +--- +author: sdwheeler +ms.author: sewhee +ms.date: 01/08/2025 +ms.topic: include +--- + +## Editorial note + +> [!IMPORTANT] +> The _Windows PowerShell Language Specification 3.0_ was published in December 2012 and is based on +> Windows PowerShell 3.0. This specification does not reflect the current state of PowerShell. There +> is no plan to update this documentation to reflect the current state. This documentation is +> presented here for historical reference. +> +> The specification document is available as a Microsoft Word document from the Microsoft Download +> Center at: [https://www.microsoft.com/download/details.aspx?id=36389][01] That Word document has +> been converted for presentation here on Microsoft Learn. During conversion, some editorial changes +> have been made to accommodate formatting for the Docs platform. Some typos and minor errors have +> been corrected. + + +[01]: https://www.microsoft.com/download/details.aspx?id=36389