Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions reference/docs-conceptual/lang-spec/chapter-01.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-02.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-03.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions reference/docs-conceptual/lang-spec/chapter-04.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-05.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-06.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-07.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Expressions
---
# 7. Expressions

[!INCLUDE [Disclaimer](../../includes/language-spec.md)]

Syntax:

```Syntax
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-08.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Statements
---
# 8. Statements

[!INCLUDE [Disclaimer](../../includes/language-spec.md)]

## 8.1 Statement blocks and lists

Syntax:
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-09.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Hashtables
---
# 10. Hashtables

[!INCLUDE [Disclaimer](../../includes/language-spec.md)]

Syntax:

> [!TIP]
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-11.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-12.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*.

Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-14.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-15.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions reference/docs-conceptual/lang-spec/chapter-16.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading