diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_ANSI_Terminals.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_ANSI_Terminals.md index aa1ae33a966a..2a3e53e02407 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_ANSI_Terminals.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_ANSI_Terminals.md @@ -7,17 +7,17 @@ title: about_ANSI_Terminals --- # about_ANSI_Terminals -## Short description +## SHORT DESCRIPTION Describes the support available for ANSI escape sequences in Windows PowerShell. -## Long description +## LONG DESCRIPTION Unlike newer versions of PowerShell, the Windows PowerShell 5.1 engine and core cmdlets don't output ANSI escape sequences to format the text displayed on your screen. However, that doesn't prevent you from using ANSI escape sequences for text formatting in terminals that support it. -## ANSI Terminal support +## ANSI TERMINAL SUPPORT On Windows 10 and higher, the Windows Console Host is [xterm][02] compatible. The [Windows Terminal][03] application is also xterm compatible. These @@ -31,7 +31,7 @@ The default colors were chosen for use with terminals that have a dark background. You can change the colors needed for your environment. For more information, see [Customizing your shell experience][01]. -## Redirecting output +## REDIRECTING OUTPUT You should be careful about creating output that's decorated with ANSI escape sequences. The formatting is intended for display in the terminal. When you diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Alias_Provider.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Alias_Provider.md index 492611cd599d..d5332fb7eaab 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Alias_Provider.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Alias_Provider.md @@ -9,23 +9,23 @@ title: about_Alias_Provider --- # about_Alias_Provider -## Provider name +## PROVIDER NAME Alias -## Drives +## DRIVES `Alias:` -## Capabilities +## CAPABILITIES **ShouldProcess** -## Short description +## SHORT DESCRIPTION Provides access to the PowerShell aliases and the values that they represent. -## Detailed description +## DETAILED DESCRIPTION The PowerShell **Alias** provider lets you get, add, change, clear, and delete aliases in PowerShell. @@ -58,12 +58,12 @@ cmdlets. - [New-Alias][10] - [Set-Alias][11] -## Types exposed by this provider +## TYPES EXPOSED BY THIS PROVIDER Each alias is an instance of the [System.Management.Automation.AliasInfo][12] class. -## Navigating the Alias drive +## NAVIGATING THE ALIAS DRIVE The **Alias** provider exposes its data store in the `Alias:` drive. To work with aliases, you can change your location to the `Alias:` drive by using the @@ -139,7 +139,7 @@ cmdlet name. Get-Item -Path Alias:* | Where-Object {$_.Definition -eq "Get-ChildItem"} ``` -## Creating aliases +## CREATING ALIASES ### Create an alias from the Alias: drive @@ -181,7 +181,7 @@ function CD32 {Set-Location -Path C:\windows\system32} Set-Item -Path Alias:go -Value CD32 ``` -## Changing aliases +## CHANGING ALIASES ### Change the options of an alias @@ -226,7 +226,7 @@ This command uses the `Rename-Item` cmdlet to change the `popd` alias to `pop`. Rename-Item -Path Alias:popd -NewName pop ``` -## Copying an alias +## COPYING AN ALIAS This command copies the `pushd` alias so that a new `push` alias is created for the `Push-Location` cmdlet. @@ -240,7 +240,7 @@ the `-Path` parameter. Copy-Item -Path Alias:pushd -Destination Alias:push ``` -## Deleting an alias +## DELETING AN ALIAS This command deletes the `serv` alias from the current session. You can use this command in any PowerShell drive. @@ -267,7 +267,7 @@ allows the command to delete aliases whose **Options** property has a value of Remove-Item Alias:* -Force ``` -## Dynamic parameters +## DYNAMIC PARAMETERS Dynamic parameters are cmdlet parameters that are added by a PowerShell provider and are available only when the cmdlet is being used in the @@ -292,14 +292,14 @@ Determines the value of the **Options** property of an alias. - [New-Item][04] - [Set-Item][14] -## Using the pipeline +## USING THE PIPELINE Provider cmdlets accept pipeline input. You can use the pipeline to simplify task by sending provider data from one cmdlet to another provider cmdlet. To read more about how to use the pipeline with provider cmdlets, see the cmdlet references provided throughout this article. -## Getting help +## GETTING HELP Beginning in Windows PowerShell 3.0, you can get customized help topics for provider cmdlets that explain how those cmdlets behave in a file system drive. @@ -316,7 +316,7 @@ Get-Help Get-ChildItem Get-Help Get-ChildItem -Path Alias: ``` -## See also +## SEE ALSO - [about_Aliases][16] - [about_Providers][17] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Aliases.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Aliases.md index d66ed1c4db53..7365ca385a8f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Aliases.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Aliases.md @@ -9,11 +9,11 @@ title: about_Aliases --- # about_Aliases -## Short description +## SHORT DESCRIPTION Describes how to use alternate names for cmdlets and commands in PowerShell. -## Long description +## LONG DESCRIPTION An alias is an alternate name or nickname for a cmdlet or for a command element, such as a function, script, file, or executable file. You can use the @@ -47,7 +47,7 @@ If you create `word` as the alias for Microsoft Office Word, you can type "C:\Program Files\Microsoft Office\Office11\Winword.exe" ``` -## Built-in aliases +## BUILT-IN ALIASES PowerShell includes a set of built-in aliases, including `cd` and `chdir` for the `Set-Location` cmdlet, and `ls` and `dir` for the `Get-ChildItem` cmdlet. @@ -58,7 +58,7 @@ To get all the aliases on the computer, including the built-in aliases, type: Get-Alias ``` -## Alias cmdlets +## ALIAS CMDLETS PowerShell includes the following cmdlets, which are designed for working with aliases: @@ -81,7 +81,7 @@ For example, type: Get-Help Export-Alias -Detailed ``` -## Creating an alias +## CREATING AN ALIAS To create a new alias, use the `New-Alias` cmdlet. For example, to create the `gh` alias for `Get-Help`, type: @@ -105,7 +105,7 @@ Or, type: gh Get-CimInstance -Detailed ``` -## Saving aliases +## SAVING ALIASES The aliases that you create are saved only in the current session. To use the aliases in a different session, add the alias to your PowerShell profile. Or, @@ -117,7 +117,7 @@ For more information, type: Get-Help about_Profiles ``` -## Getting aliases +## GETTING ALIASES To get all the aliases in the current session, including the built-in aliases, the aliases in your PowerShell profiles, and the aliases that you have created @@ -164,7 +164,7 @@ hyphen. These are likely to be preferred substitute names for cmdlets and functions, instead of typical abbreviations or nicknames, and the author might not want them to be as evident. -## Alternate names for commands with parameters +## ALTERNATE NAMES FOR COMMANDS WITH PARAMETERS You can assign an alias to a cmdlet, script, function, or executable file. You cannot assign an alias to a command and its parameters. For example, you can @@ -192,7 +192,7 @@ For more information about functions, type: Get-Help about_Functions ``` -## Alias objects +## ALIAS OBJECTS PowerShell aliases are represented by objects that are instances of the System.Management.Automation.AliasInfo class. For more information about this @@ -216,7 +216,7 @@ the `dir` alias. The following command performs these tasks: Get-Alias -Name dir | Format-List -Property * ``` -## PowerShell Alias provider +## POWERSHELL ALIAS PROVIDER PowerShell includes the Alias provider. The Alias provider lets you view the aliases in PowerShell as though they were on a file system drive. @@ -255,7 +255,7 @@ For more information about the PowerShell Alias provider, type: Get-Help Alias ``` -## See also +## SEE ALSO - [about_Functions](about_Functions.md) - [about_Profiles](about_Profiles.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index 919d5b3b4297..577b5f28e120 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -8,11 +8,11 @@ title: about_Arithmetic_Operators --- # about_Arithmetic_Operators -## Short description +## SHORT DESCRIPTION Describes the operators that perform arithmetic in PowerShell. -## Long description +## LONG DESCRIPTION Arithmetic operators calculate numeric values. You can use one or more arithmetic operators to add, subtract, multiply, and divide values, and to @@ -107,7 +107,7 @@ PowerShell supports the following arithmetic operators: 102 -shr 2 # result = 25 ``` -## Operator precedence +## OPERATOR PRECEDENCE PowerShell processes arithmetic operators in the following order: @@ -160,7 +160,7 @@ $a = $a + 1 $b[$a] = $tmp ``` -## Division and rounding +## DIVISION AND ROUNDING When the quotient of a division operation is an integer, PowerShell rounds the value to the nearest integer. When the value is `.5`, it rounds to the nearest @@ -192,7 +192,7 @@ PS> [int][Math]::Floor(5 / 2) For more information, see the [Math.Round](/dotnet/api/system.math.round) method. -## Type conversion to accommodate result +## TYPE CONVERSION TO ACCOMMODATE RESULT PowerShell automatically selects the .NET numeric type that best expresses the result without losing precision. For example: @@ -309,7 +309,7 @@ PS> 1 / [int]1.9 0.5 ``` -## Adding and multiplying non numeric types +## ADDING AND MULTIPLYING NON NUMERIC TYPES You can add numbers, strings, arrays, and hash tables. And, you can multiply numbers, strings, and arrays. However, you can't multiply hash tables. @@ -469,7 +469,7 @@ $array 2 ``` -## Arithmetic operators and variables +## ARITHMETIC OPERATORS AND VARIABLES You can also use arithmetic operators with variables. The operators act on the values of the variables. The following examples demonstrate the use of @@ -487,7 +487,7 @@ PS> $a + $b PowerShell ``` -## Arithmetic operators and commands +## ARITHMETIC OPERATORS AND COMMANDS Typically, you use the arithmetic operators in expressions with numbers, strings, and arrays. However, you can also use arithmetic operators with the @@ -522,7 +522,7 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName In the above expression, each process working space (`$_.WS`) is multiplied by `2`; and, the result, compared against `50mb` to see if it's greater than that. -## Bitwise operators +## BITWISE OPERATORS PowerShell supports the standard bitwise operators, including bitwise-AND (`-band`), the inclusive and exclusive bitwise-OR operators (`-bor` and @@ -631,7 +631,7 @@ unsigned values, a zero is inserted in the left-most position. | `(-21 -shr 1)` | -11 | 11111111111111111111111111110101 | 0xFFFFFFF5 | | `(-21 -shr 2)` | -6 | 11111111111111111111111111111010 | 0xFFFFFFF4 | -## See also +## SEE ALSO - [about_Arrays](about_Arrays.md) - [about_Hash_Tables](about_Hash_Tables.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md index 9ecfe8fa992e..9ae43a80bc49 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -9,12 +9,12 @@ title: about_Arrays --- # about_Arrays -## Short description +## SHORT DESCRIPTION Describes arrays, which are data structures designed to store collections of items. -## Long description +## LONG DESCRIPTION An array is a data structure that's designed to store a collection of items. The items can be the same type or different types. @@ -22,7 +22,7 @@ The items can be the same type or different types. Beginning in Windows PowerShell 3.0, a collection of zero or one object has some properties of arrays. -## Creating and initializing an array +## CREATING AND INITIALIZING AN ARRAY To create and initialize an array, assign multiple values to a variable. The values stored in the array are delimited with a comma and separated from the @@ -82,7 +82,7 @@ process objects, enter the following command: [Diagnostics.Process[]]$zz = Get-Process ``` -## The array sub-expression operator +## THE ARRAY SUB-EXPRESSION OPERATOR The array sub-expression operator creates an array from the statements inside it. Whatever the statement inside the operator produces, the operator places it @@ -125,7 +125,7 @@ $p = @(Get-Process Notepad) For more information about the array sub-expression operator, see [about_Operators][11]. -## Accessing and using array elements +## ACCESSING AND USING ARRAY ELEMENTS ### Reading an array @@ -338,7 +338,7 @@ while($i -lt 4) { 3 ``` -## Properties of arrays +## PROPERTIES OF ARRAYS ### Count or Length or LongLength @@ -463,7 +463,7 @@ True 40 ``` -## Methods of arrays +## METHODS OF ARRAYS ### Clear @@ -803,7 +803,7 @@ Stopped AppIDSvc Application Identity > Both `ForEach()` and `Where()` methods are intrinsic members. For more > information about intrinsic members, see [about_Intrinsic_Members][08]. -## Get the members of an array +## GET THE MEMBERS OF AN ARRAY To get the properties and methods of an array, such as the **Length** property and the **SetValue** method, use the **InputObject** parameter of the @@ -833,7 +833,7 @@ and `Get-Member` returns the members of the array. Like the next two examples. ,(1,2,3) | Get-Member ``` -## Manipulating an array +## MANIPULATING AN ARRAY You can change the elements in an array, add an element to an array, and combine the values from two arrays into a third array. @@ -899,7 +899,7 @@ command deletes the array in the `$a` variable. You can also use the `Remove-Item` cmdlet, but assigning a value of `$null` is faster, especially for large arrays. -## Arrays of zero or one +## ARRAYS OF ZERO OR ONE Beginning in Windows PowerShell 3.0, a scalar types and collection of zero or one objects has the **Count** and **Length** properties. Also, you can use @@ -984,7 +984,7 @@ PS> $result[0].Length -## Indexing .NET types that implement `IDictionary` +## INDEXING .NET TYPES THAT IMPLEMENT `IDICTIONARY` PowerShell doesn't call a type's true indexer for types that implement the generic `IDictionary` interface. Instead, when given a key, @@ -1009,7 +1009,7 @@ At line:1 char:1 + FullyQualifiedErrorId : ExceptionWhenGetting ``` -## Member-access enumeration +## MEMBER-ACCESS ENUMERATION Starting in PowerShell 3.0, when you use the member-access operator to access a member that doesn't exist on a list collection, PowerShell automatically @@ -1090,7 +1090,7 @@ LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;} > Since the method is executed for each item in the collection, care should be > taken when calling methods using member enumeration. -## See also +## SEE ALSO - [about_For][05] - [about_Foreach][06] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Assignment_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Assignment_Operators.md index ef6fd3636320..f172db6b706f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Assignment_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Assignment_Operators.md @@ -8,11 +8,11 @@ title: about_Assignment_Operators --- # about_Assignment_Operators -## Short description +## SHORT DESCRIPTION Describes how to use operators to assign values to variables. -## Long description +## LONG DESCRIPTION Assignment operators assign one or more values to a variable. The equals sign (`=`) is the PowerShell assignment operator. PowerShell also has the following @@ -20,7 +20,7 @@ _compound_ assignment operators: `+=`, `-=`, `*=`, `%=`, `++`, `--`, `??=`. Compound assignment operators perform operations on the values before the assignment. -## Syntax +## SYNTAX The syntax of the assignment operators is as follows: @@ -38,7 +38,7 @@ postfix versions. The value of the assignable expression must be a number or it must be convertible to a number. -## Using the assignment operator +## USING THE ASSIGNMENT OPERATOR Variables are named memory spaces that store values. You store the values in variables using the assignment operator `=`. The new value can replace the @@ -137,7 +137,7 @@ variable, type: $a = 10kb ``` -## Using compound assignment operators +## USING COMPOUND ASSIGNMENT OPERATORS Compound assignment operators perform numeric operations on the values before the assignment. @@ -630,7 +630,7 @@ $d 7 ``` -## Microsoft .NET types +## MICROSOFT .NET TYPES By default, when a variable has only one value, the value that's assigned to the variable determines the data type of the variable. For example, the @@ -790,7 +790,7 @@ data type. The value of the `$a` variable would be the following: Tuesday, May 31, 2005 12:00:00 AM ``` -## Assigning multiple variables +## ASSIGNING MULTIPLE VARIABLES In PowerShell, you can assign values to multiple variables using a single command. The first element of the assignment value is assigned to the first @@ -843,7 +843,7 @@ four variables: $a = $b = $c = $d = "three" ``` -## Variable-related cmdlets +## VARIABLE-RELATED CMDLETS In addition to using an assignment operation to set a variable value, you can also use the [Set-Variable][09] cmdlet. For example, the following command uses @@ -853,7 +853,7 @@ also use the [Set-Variable][09] cmdlet. For example, the following command uses Set-Variable -Name a -Value 1, 2, 3 ``` -## See also +## SEE ALSO - [about_Arrays][02] - [about_Hash_Tables][03] 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 cd4a74bdcb66..205fa6b2e21e 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 @@ -10,11 +10,13 @@ title: about_Automatic_Variables # about_Automatic_Variables -## Short description +## SHORT DESCRIPTION Describes variables that store state information for and are created and maintained by PowerShell. +## LONG DESCRIPTION + Conceptually, most of these variables are considered to be read-only. Even though they _can_ be written to, for backward compatibility they _should not_ be written to. @@ -64,8 +66,6 @@ Here is a list of the automatic variables in PowerShell: - [`$this`][47] - [`$true`][48] -## Long description - ### `$$` Contains the last token in the last line received by the session. @@ -685,7 +685,7 @@ object originating the event, known as the event sender. Contains **True**. You can use this variable to represent **True** in commands and scripts. -## Using Enumerators +## USING ENUMERATORS The `$input`, `$foreach`, and `$switch` variables are all enumerators used to iterate through the values processed by their containing code block. @@ -734,7 +734,7 @@ the current position of the enumerator. The **Current** property continues to return the same property until **MoveNext** is called. -## Examples +## EXAMPLES ### Example 1: Using the $input variable @@ -1024,7 +1024,7 @@ Default (Current): Start Default (Current): End ``` -## See also +## SEE ALSO - [about_Functions][62] - [about_Functions_Advanced][59] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Booleans.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Booleans.md index 417dbcd6848d..597c67c25849 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Booleans.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Booleans.md @@ -8,16 +8,16 @@ title: about_Booleans --- # about_Booleans -## Short description +## SHORT DESCRIPTION Describes how boolean expressions are evaluated. -## Long description +## LONG DESCRIPTION PowerShell can implicitly treat any type as a **Boolean**. It is important to understand the rules that PowerShell uses to convert other types to **Boolean** values. -## Converting from scalar types +## CONVERTING FROM SCALAR TYPES A [scalar][02] type is an atomic quantity that can hold only one value at a time. The following types evaluate to `$false`: @@ -71,7 +71,7 @@ MethodInvocationException: Exception calling "Parse" with "1" argument(s): "String 'Not True' was not recognized as a valid Boolean." ``` -## Converting from collection types +## CONVERTING FROM COLLECTION TYPES Arrays are the most common collection type in PowerShell. These rules apply to any collection-like types that implement the [IList][01] interface. @@ -105,7 +105,7 @@ PS> [bool]$c True ``` -## See also +## SEE ALSO - [about_Arrays][03] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Break.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Break.md index 62562c24326a..62486ff92177 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Break.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Break.md @@ -8,19 +8,19 @@ title: about_Break --- # about_Break -## Short description +## SHORT DESCRIPTION Describes the `break` statement, which provides a way to exit the current control block. -## Long description +## LONG DESCRIPTION The `break` statement provides a way to exit the current control block. Execution continues at the next statement after the control block. The statement supports labels. A label is a name you assign to a statement in a script. -## Using `break` in loops +## USING `BREAK` IN LOOPS When a `break` statement appears in a loop, such as a `foreach`, `for`, `do`, or `while` loop, PowerShell immediately exits the loop. @@ -121,7 +121,7 @@ loop. No label is needed. PowerShell does not limit how far labels can resume execution. The label can even pass control across script and function call boundaries. -## Using `break` in a `switch` statement +## USING `BREAK` IN A `SWITCH` STATEMENT In a `switch` construct, `break` causes PowerShell to exit the `switch` code block. @@ -166,7 +166,7 @@ exits. If the four `break` statements are removed from the example, all four conditions are met. This example uses the `break` statement to display results when the most specific condition is met. -## Using `break` in a `trap` statement +## USING `BREAK` IN A `TRAP` STATEMENT If the final statement executed in the body of a `trap` statement is `break`, the error object is suppressed and the exception is re-thrown. @@ -208,7 +208,7 @@ At line:10 char:6 + FullyQualifiedErrorId : RuntimeException ``` -## Do not use `break` outside of a loop, `switch`, or `trap` +## DO NOT USE `BREAK` OUTSIDE OF A LOOP, `SWITCH`, OR `TRAP` When `break` is used outside of a construct that directly supports it (loops, `switch`, `trap`), PowerShell looks _up the call stack_ for an @@ -223,7 +223,7 @@ Using `break` inside a pipeline `break`, such as a `ForEach-Object` script block, not only exits the pipeline, it potentially terminates the entire runspace. -## See also +## SEE ALSO - [about_Comparison_Operators](about_Comparison_Operators.md) - [about_Continue](about_Continue.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Built-in_Functions.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Built-in_Functions.md index e52b71524de4..56a567a4722a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Built-in_Functions.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Built-in_Functions.md @@ -8,11 +8,11 @@ title: about_Built-in_Functions --- # about_Built-in_Functions -## Short description +## SHORT DESCRIPTION Describes the built-in functions in PowerShell. -## Long description +## LONG DESCRIPTION PowerShell includes a set of functions that are loaded into every PowerShell session. These functions are similar to cmdlets but they're not included in any @@ -21,69 +21,69 @@ module. They're defined in the PowerShell engine itself. These functions are provided as shorthand helpers for common tasks. In many cases, these functions call an existing cmdlet with an additional parameter. -## `cd..` +## `CD..` In the Windows CMD shell it's common to run the `cd` command without any spaces between the command and the destination path. This function runs `Set-Location ..` to change to the parent folder. -## `cd\` +## `CD\` In the Windows CMD shell it's common to run the `cd` command without any spaces between the command and the destination path. This function runs `Set-Location \` to change to the root folder. -## `Pause` +## `PAUSE` This function replicates the behavior of the `pause` command from `cmd.exe`. The script pauses execution and prompts the user to hit a key to continue. -## `Get-Verb` +## `GET-VERB` This function lists PowerShell verbs and the category group they belong to. For more information, see [Get-Verb](xref:Microsoft.PowerShell.Core.Get-Verb) -## `help` (alias: `man`) +## `HELP` (ALIAS: `MAN`) This function invokes `Get-Help` with your parameters and passes the output to the system's pager command, `more.com`. -## `ImportSystemModules` +## `IMPORTSYSTEMMODULES` This function has been deprecated. It is an empty function that does nothing. -## `prompt` +## `PROMPT` This is the function that creates the default prompt for the PowerShell command line. You can customize your prompt by overriding this function with your own. For more information see [about_Prompts](about_Prompts.md). -## `more` +## `MORE` This function is a wrapper around the `more.com` native command. -## `Clear-Host` +## `CLEAR-HOST` This function clears the screen. For more information, see [Clear-Host](xref:Microsoft.PowerShell.Core.Clear-Host). -## `TabExpansion2` +## `TABEXPANSION2` This is the default function to use for tab expansion. For more information, see [TabExpansion2](xref:Microsoft.PowerShell.Core.TabExpansion2). -## `oss` +## `OSS` This function provides a short hand way to run `Out-String -Stream` in a pipeline. For more information, see [Out-String](xref:Microsoft.PowerShell.Utility.Out-String). -## `mkdir` (alias: `md`) +## `MKDIR` (ALIAS: `MD`) This function provides a short hand way to run `New-Item -Type Directory` with your parameters. -## Windows drive letter functions +## WINDOWS DRIVE LETTER FUNCTIONS In Windows, drive mount points are associated with a drive letter like `C:`. You can switch to the current location on another drive just by entering that diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Calculated_Properties.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Calculated_Properties.md index bba876d06912..7d5359ca8347 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Calculated_Properties.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Calculated_Properties.md @@ -8,12 +8,12 @@ title: about_Calculated_Properties --- # about_Calculated_Properties -## Short description +## SHORT DESCRIPTION PowerShell provides the ability to dynamically add new properties and alter the formatting of objects output to the pipeline. -## Long description +## LONG DESCRIPTION Several PowerShell cmdlets transform, group, or process input objects into output objects using parameters that allow the addition of new properties to @@ -23,7 +23,7 @@ calculated property is defined by a [hashtable][03] containing key-value pairs that specify the name of the new property, an expression to calculate the value, and optional formatting information. -## Supported cmdlets +## SUPPORTED CMDLETS The following cmdlets support calculated property values for the **Property** parameter. The `Format-*` cmdlets also support calculated values for the @@ -83,7 +83,7 @@ the key-value pairs that each cmdlet supports. > The value of the `Expression` can be a script block instead of a > hashtable. For more information, see the [Notes][02] section. -## Hashtable key definitions +## HASHTABLE KEY DEFINITIONS - `Name`/`Label` - Specifies the name of the property being created. You can use `Name` or its alias, `Label`, interchangeably. @@ -109,7 +109,7 @@ You don't need to spell out the hashtable keys as long as the specified name prefix is unambiguous. For example, you can use `n` instead of `Name` and `e` instead of `Expression`. -## Examples +## EXAMPLES ### Compare-Object @@ -443,7 +443,7 @@ Date Salesperson UnitsSold 2020-08-04 Sally 2 ``` -## Notes +## NOTES - You may specify the expression script block _directly_, as an argument, rather than specifying it as the `Expression` entry in a hashtable. For @@ -471,7 +471,7 @@ Date Salesperson UnitsSold For `Sort-Object`, statement-terminating and script-terminating errors are _output_ but they don't terminate the statement. -## See also +## SEE ALSO - [about_Hash_Tables][03] - [ConvertTo-Html][05] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Case-Sensitivity.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Case-Sensitivity.md index fce34a74baeb..f90c5e9b612f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Case-Sensitivity.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Case-Sensitivity.md @@ -8,11 +8,11 @@ title: about_Case-Sensitivity --- # about_Case-Sensitivity -## Short description +## SHORT DESCRIPTION PowerShell is as case-insensitive as possible while preserving case. -## Long description +## LONG DESCRIPTION As a general principle, PowerShell is as case insensitive as possible while preserving case and not breaking the underlying OS. @@ -23,7 +23,7 @@ On Unix-based systems, PowerShell is case-sensitive because filesystem manipulation and environment variables directly affect the underlying operating system and integration with other tools. -## On all systems +## ON ALL SYSTEMS - PowerShell variables are case-insensitive @@ -45,7 +45,7 @@ operating system and integration with other tools. case-sensitive filesystem. When the case of the imported name of the module doesn't match, `Update-Help` can't find the help files and reports an error. -## Related links +## RELATED LINKS - [about_Environment_Variables](about_Environment_Variables.md) - [Import-Module](xref:Microsoft.PowerShell.Core.Import-Module) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Character_Encoding.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Character_Encoding.md index cc8da665cfef..f00e9d16b741 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Character_Encoding.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Character_Encoding.md @@ -8,12 +8,12 @@ title: about_Character_Encoding --- # about_Character_Encoding -## Short description +## SHORT DESCRIPTION Describes how PowerShell uses character encoding for input and output of string data. -## Long description +## LONG DESCRIPTION Unicode is a worldwide character-encoding standard. The system uses Unicode exclusively for character and string manipulation. For a detailed description @@ -45,7 +45,7 @@ The following cmdlets have the **Encoding** parameter: - Select-String - Send-MailMessage -## The byte-order-mark +## THE BYTE-ORDER-MARK The byte-order-mark (BOM) is a _Unicode signature_ in the first few bytes of a file or text stream that indicate which Unicode encoding used for the data. For @@ -72,7 +72,7 @@ UTF-8 BOM can be problematic on Unix-like platforms. Many Unix tools such as `cat`, `sed`, `awk`, and some editors such as `gedit` don't know how to treat the BOM. -## Character encoding in Windows PowerShell +## CHARACTER ENCODING IN WINDOWS POWERSHELL In PowerShell 5.1, the **Encoding** parameter supports the following values: @@ -151,7 +151,7 @@ For cmdlets that read string data in the absence of a BOM: - `Import-Csv`, `Import-Clixml`, and `Select-String` assume `Utf8` in the absence of a BOM. -## Character encoding in PowerShell +## CHARACTER ENCODING IN POWERSHELL In PowerShell (v7.1 and higher), the **Encoding** parameter supports the following values: @@ -174,7 +174,7 @@ IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for [Encoding.CodePage][04]. -## Changing the default encoding +## CHANGING THE DEFAULT ENCODING PowerShell has two default variables that can be used to change the default encoding behavior. @@ -213,7 +213,7 @@ The automatic variable `$OutputEncoding` affects the encoding PowerShell uses to communicate with external programs. It has no effect on the encoding that the output redirection operators and PowerShell cmdlets use to save to files. -## See also +## SEE ALSO - [about_Preference_Variables][05] - [Byte order mark](https://wikipedia.org/wiki/Byte_order_mark) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_CimSession.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_CimSession.md index 3d79bdb7de6a..02b3139949f5 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_CimSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_CimSession.md @@ -8,12 +8,12 @@ title: about_CimSession --- # about_CimSession -## Short description +## SHORT DESCRIPTION Describes a **CimSession** object and the difference between CIM sessions and PowerShell sessions. -## Long description +## LONG DESCRIPTION A Common Information Model (CIM) session is a client-side object that represents a connection to a local computer or a remote computer. You can use @@ -36,7 +36,7 @@ connection. If you use CIM sessions, PowerShell does not open a network connection until needed. For more information about PowerShell sessions, see [about_PSSessions][01]. -## When to use a CIM session +## WHEN TO USE A CIM SESSION Only cmdlets that work with a Windows Management Instrumentation (WMI) provider or CIM over WS-Man accept CIM sessions. For other cmdlets, use **PSSessions**. @@ -51,7 +51,7 @@ back to the local computer. PowerShell manages the data sent over the connection, and keeps the size within the limits set by Windows Remote Management (WinRM). CIM sessions do not impose the WinRM limits. -## Using CDXML cmdlets +## USING CDXML CMDLETS CIM-based Cmdlet Definition XML (CDXML) cmdlets can be written to use any WMI Provider. All WMI providers use **CimSession** objects. For more information @@ -63,7 +63,7 @@ CIM Connections to 15. This limit can be overridden by CDXML cmdlets that implement the **ThrottleLimit**. See the individual cmdlet documentation to understand the **ThrottleLimit**. -## See also +## SEE ALSO - [about_PSSessions][01] - [New-CimSession][03] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes.md index 2e214a7917a4..812e0c5306ee 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes.md @@ -8,10 +8,10 @@ title: about_Classes --- # about_Classes -## Short description +## SHORT DESCRIPTION Describes how you can use classes to create your own custom types. -## Long description +## LONG DESCRIPTION Starting with version 5.0, PowerShell has a formal syntax to define classes and other user-defined types. The addition of classes enables developers and IT @@ -24,7 +24,7 @@ example, if you declare a class named **Device** and initialize a variable **Device**. Each instance of **Device** can have different values in its properties. -## Supported scenarios +## SUPPORTED SCENARIOS - Define custom types in PowerShell using object-oriented programming semantics like classes, properties, methods, inheritance, etc. @@ -34,7 +34,7 @@ properties. definitions. - Define custom exceptions that can be caught by their type name. -## Syntax +## SYNTAX ### Definition syntax @@ -76,7 +76,7 @@ To instantiate an instance of a class, use one of the following syntaxes: > properties. If any key in the hashtable isn't a valid property name, > PowerShell raises an error. -## Examples +## EXAMPLES ### Example 1 - Minimal definition @@ -362,7 +362,7 @@ At C:\code\classes.examples.ps1:114 char:13 already in list ``` -## Class properties +## CLASS PROPERTIES Properties are variables declared in the class scope. A property can be of any built-in type or an instance of another class. Classes can have zero or more @@ -370,7 +370,7 @@ properties. Classes don't have a maximum property count. For more information, see [about_Classes_Properties][01]. -## Class methods +## CLASS METHODS Methods define the actions that a class can perform. Methods can take parameters that specify input data. Methods always define an output type. If a @@ -380,7 +380,7 @@ method doesn't explicitly define an output type, the method's output type is For more information, see [about_Classes_Methods][02]. -## Class constructors +## CLASS CONSTRUCTORS Constructors enable you to set default values and validate object logic at the moment of creating the instance of the class. Constructors have the same name @@ -389,7 +389,7 @@ members of the new object. For more information, see [about_Classes_Constructors][03]. -## Hidden keyword +## HIDDEN KEYWORD The `hidden` keyword hides a class member. The member is still accessible to the user and is available in all scopes in which the object is available. @@ -422,7 +422,7 @@ more information about hidden methods, see [about_Classes_Methods][06]. For more information about hidden constructors, see [about_Classes_Constructors][07]. -## Static keyword +## STATIC KEYWORD The `static` keyword defines a property or a method that exists in the class and needs no instance. @@ -438,7 +438,7 @@ For more information about static properties, see [about_Classes_Methods][09]. For more information about static constructors, see [about_Classes_Constructors][10]. -## Inheritance in PowerShell classes +## INHERITANCE IN POWERSHELL CLASSES You can extend a class by creating a new class that derives from an existing class. The derived class inherits the properties and methods of the base class. @@ -455,7 +455,7 @@ For more information about deriving classes that inherit from a base class or implement interfaces, see [about_Classes_Inheritance][11]. -## Exporting classes with type accelerators +## EXPORTING CLASSES WITH TYPE ACCELERATORS By default, PowerShell modules don't automatically export classes and enumerations defined in PowerShell. The custom types aren't available outside @@ -525,7 +525,7 @@ When users import the module, any types added to the type accelerators for the session are immediately available for IntelliSense and completion. When the module is removed, so are the type accelerators. -## Manually importing classes from a PowerShell module +## MANUALLY IMPORTING CLASSES FROM A POWERSHELL MODULE `Import-Module` and the `#Requires` statement only import the module functions, aliases, and variables, as defined by the module. Classes aren't imported. @@ -541,7 +541,7 @@ to be available to users outside of the module directly in the root module. For more information about the `using` statement, see [about_Using][12]. -## Loading newly changed code during development +## LOADING NEWLY CHANGED CODE DURING DEVELOPMENT During development of a script module, it's common to make changes to the code then load the new version of the module using `Import-Module` with the @@ -558,7 +558,7 @@ files. If you have function in one file that use classes defined in another module, you should use the `using module` statement to ensure that the functions have the class definitions that are needed. -## The PSReference type isn't supported with class members +## THE PSREFERENCE TYPE ISN'T SUPPORTED WITH CLASS MEMBERS The `[ref]` type accelerator is shorthand for the **PSReference** class. Using `[ref]` to type-cast a class member fails silently. APIs that use `[ref]` @@ -568,7 +568,7 @@ a value in by reference. For more information, see [PSReference Class][13]. -## Limitations +## LIMITATIONS The following lists include limitations for defining PowerShell classes and workaround for those limitations, if any. @@ -678,7 +678,7 @@ workaround for those limitations, if any. statement to load the type. There's no workaround for a custom type to use itself as the type parameter when inheriting from a generic. -## See also +## SEE ALSO - [about_Classes_Constructors][03] - [about_Classes_Inheritance][11] 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 2d647f75b452..918e6d2c56dc 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 @@ -9,11 +9,11 @@ title: about_Classes_Constructors # about_Classes_Constructors -## Short description +## SHORT DESCRIPTION Describes how to define constructors for PowerShell classes. -## Long description +## LONG DESCRIPTION Constructors enable you to set default values and validate object logic at the moment of creating the instance of the class. Constructors have the same name @@ -41,7 +41,7 @@ is needed. You can also define a parameterless [static constructor][02]. -## Syntax +## SYNTAX Class constructors use the following syntaxes: @@ -80,7 +80,7 @@ static () [: base([])] { } ``` -## Examples +## EXAMPLES ### Example 1 - Defining a class with the default constructor @@ -382,7 +382,7 @@ VERBOSE: [BaseExample] default constructor VERBOSE: [DerivedExample] param constructor (foo) ``` -## Constructor run ordering +## CONSTRUCTOR RUN ORDERING When a class instantiates, the code for one or more constructors executes. @@ -405,7 +405,7 @@ In all cases, static constructors only run once in a session. For an example of constructor behavior and ordering, see [Example 5][06]. -## Hidden constructors +## HIDDEN CONSTRUCTORS You can hide constructors of a class by declaring them with the `hidden` keyword. Hidden class constructors are: @@ -426,7 +426,7 @@ keyword. Hidden class constructors are: For more information about the `hidden` keyword, see [about_Hidden][04]. -## Static constructors +## STATIC CONSTRUCTORS You can define a constructor as belonging to the class itself instead of instances of the class by declaring the constructor with the `static` keyword. @@ -437,7 +437,7 @@ Static class constructors: - Can't have any parameters. - Can't access instance properties or methods with the `$this` variable. -## Constructors for derived classes +## CONSTRUCTORS FOR DERIVED CLASSES When a class inherits from another class, constructors can invoke a constructor from the base class with the `base` keyword. If the derived class doesn't @@ -464,14 +464,14 @@ can be any of the following items: For an example of constructors on a derived class, see [Example 5][06]. -## Chaining constructors +## CHAINING CONSTRUCTORS Unlike C#, PowerShell class constructors can't use chaining with the `: this()` syntax. To reduce code duplication, use a hidden `Init()` method with multiple overloads to the same effect. [Example 4][05] shows a class using this pattern. -## Adding instance properties and methods with Update-TypeData +## ADDING INSTANCE PROPERTIES AND METHODS WITH UPDATE-TYPEDATA Beyond declaring properties and methods directly in the class definition, you can define properties for instances of a class in the static constructor using @@ -512,7 +512,7 @@ For more information about defining instance methods with `Update-TypeData`, see [about_Classes_Methods][07]. For more information about defining instance properties with `Update-TypeData`, see [about_Classes_Properties][08]. -## Limitations +## LIMITATIONS PowerShell class constructors have the following limitations: @@ -534,7 +534,7 @@ PowerShell class constructors have the following limitations: Workaround: None. -## See also +## SEE ALSO - [about_Classes][10] - [about_Classes_Inheritance][11] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Inheritance.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Inheritance.md index bbf4122351a7..c6370506f928 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Inheritance.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Inheritance.md @@ -9,11 +9,11 @@ title: about_Classes_Inheritance # about_Classes_Inheritance -## Short description +## SHORT DESCRIPTION Describes how you can define classes that extend other types. -## Long description +## LONG DESCRIPTION PowerShell classes support _inheritance_, which allows you to define a child class that reuses (inherits), extends, or modifies the behavior of a parent @@ -68,7 +68,7 @@ base class. class Derived : Base, Interface {...} ``` -## Syntax +## SYNTAX Class inheritance uses the following syntaxes: @@ -111,7 +111,7 @@ class Derived : Base, } ``` -## Examples +## EXAMPLES ### Example 1 - Inheriting and overriding from a base class @@ -1386,7 +1386,7 @@ The module loads without errors because the **InventoryItem** class is defined in a different module file than the **Inventory** class. Both classes are available to module users. -## Inheriting a base class +## INHERITING A BASE CLASS When a class inherits from a base class, it inherits the properties and methods of the base class. It doesn't inherit the base class constructors directly, @@ -1535,7 +1535,7 @@ them can be used for. managing lists of a specific data type easier. - **System.Exception** - Derive classes to define custom errors. -## Implementing interfaces +## IMPLEMENTING INTERFACES A PowerShell class that implements an interface must implement all the members of that interface. Omitting the implementation interface members causes a @@ -1574,7 +1574,7 @@ derived from them can be used for. of the class to other runtime types. This is useful for classes that have an underlying numerical value or can be converted to one. -## Limitations +## LIMITATIONS - PowerShell doesn't support defining interfaces in script code. @@ -1593,7 +1593,7 @@ derived from them can be used for. to load the type. There's no workaround for a custom type to use itself as the type parameter when inheriting from a generic. -## See Also +## SEE ALSO - [about_Classes][08] - [about_Classes_Constructors][09] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Methods.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Methods.md index f1bc886ef7d4..7d40fb851a0c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Methods.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Methods.md @@ -9,11 +9,11 @@ title: about_Classes_Methods # about_Classes_Methods -## Short description +## SHORT DESCRIPTION Describes how to define methods for PowerShell classes. -## Long description +## LONG DESCRIPTION Methods define the actions that a class can perform. Methods can take parameters that specify input data. Methods always define an output type. If a @@ -44,7 +44,7 @@ methods. Class methods can have any number of attributes, including the [hidden][02] and [static][03] attributes. -## Syntax +## SYNTAX Class methods use the following syntaxes: @@ -65,7 +65,7 @@ Class methods use the following syntaxes: } ``` -## Examples +## EXAMPLES ### Example 1 - Minimal method definition @@ -284,7 +284,7 @@ VERBOSE: Called [ExampleCube4]::GetVolume(2, 2, 0, False) 0 ``` -## Method signatures and overloads +## METHOD SIGNATURES AND OVERLOADS Every class method has a unique signature that defines how to call the method. The method's output type, name, and parameters define the method signature. @@ -342,14 +342,14 @@ class CardDeck { } ``` -## Method output +## METHOD OUTPUT By default, methods don't have any output. If a method signature includes an explicit output type other than **Void**, the method must return an object of that type. Methods don't emit any output except when the `return` keyword explicitly returns an object. -## Method parameters +## METHOD PARAMETERS Class methods can define input parameters to use in the method body. Method parameters are enclosed in parentheses and are separated by commas. Empty @@ -392,7 +392,7 @@ parameters: For more information, see the [Defining instance methods with Update-TypeData][06] section. -## Automatic variables in methods +## AUTOMATIC VARIABLES IN METHODS Not all automatic variables are available in methods. The following list includes automatic variables and suggestions for whether and how to use them in @@ -446,7 +446,7 @@ available to class methods. For more information about automatic variables, see [about_Automatic_Variables][07]. -## Hidden methods +## HIDDEN METHODS You can hide methods of a class by declaring them with the `hidden` keyword. Hidden class methods are: @@ -466,7 +466,7 @@ Hidden class methods are: For more information about the `hidden` keyword, see [about_Hidden][08]. -## Static methods +## STATIC METHODS You can define a method as belonging to the class itself instead of instances of the class by declaring the method with the `static` keyword. Static class @@ -479,7 +479,7 @@ methods: properties. - Live for the entire session span. -## Derived class methods +## DERIVED CLASS METHODS When a class derives from a base class, it inherits the methods of the base class and their overloads. Any method overloads defined on the base class, @@ -653,7 +653,7 @@ $b.SetTimeStamp() => 2023-11-06 $c.SetTimeStamp() => 10/27/2023 9:53:58 AM ``` -## Defining instance methods with Update-TypeData +## DEFINING INSTANCE METHODS WITH UPDATE-TYPEDATA Beyond declaring methods directly in the class definition, you can define methods for instances of a class in the static constructor using the @@ -764,7 +764,7 @@ You ate 6 cookies. There are 4 left. > raise a meaningful error instead. That way, users can understand why they're > seeing the error and what to do about it. -## Limitations +## LIMITATIONS PowerShell class methods have the following limitations: @@ -787,7 +787,7 @@ PowerShell class methods have the following limitations: Workaround: None. -## See also +## SEE ALSO - [about_Automatic_Variables][07] - [about_Classes][09] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md index 7ac91c1c2b84..b36cdcb4c777 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md @@ -9,11 +9,11 @@ title: about_Classes_Properties # about_Classes_Properties -## Short description +## SHORT DESCRIPTION Describes how to define properties for PowerShell classes. -## Long description +## LONG DESCRIPTION Properties are members of the class that contain data. Properties are declared as variables in the class scope. A property can be of any built-in type or an @@ -24,7 +24,7 @@ Class properties can have any number of attributes, including the [hidden][01] and [static][02] attributes. Every property definition must include a type for the property. You can define a default value for a property. -## Syntax +## SYNTAX Class properties use the following syntaxes: @@ -42,7 +42,7 @@ Class properties use the following syntaxes: $ [= ] ``` -## Examples +## EXAMPLES ### Example 1 - Minimal class properties @@ -452,7 +452,7 @@ DueDate : 1/1/0001 12:00:00 AM With the properties set correctly, the **Duration** property returns a timespan representing how long the project ran. -## Default property values +## DEFAULT PROPERTY VALUES Every class property has an implicit default value depending on the type of the property. @@ -495,7 +495,7 @@ Name Description Guid Hidden and static properties can also have default values. -## Hidden properties +## HIDDEN PROPERTIES You can hide properties of a class by declaring them with the `hidden` keyword. Hidden class properties are: @@ -512,7 +512,7 @@ Hidden class properties are: For more information about the `hidden` keyword, see [about_Hidden][07]. -## Static properties +## STATIC PROPERTIES You can define a property as belonging to the class itself instead of instances of the class by declaring the property with the `static` keyword. Static class @@ -530,7 +530,7 @@ properties: > can be overridden to any valid value, as defined by the static property's > type and attributes. -## Derived class properties +## DERIVED CLASS PROPERTIES When a class derives from a base class, it inherits the properties of the base class. Any properties defined on the base class, including hidden properties, @@ -632,7 +632,7 @@ changed value affects every class except for **DerivedClassD**. For more information about class inheritance, including a comprehensive example, see [about_Classes_Inheritance][08]. -## Using property attributes +## USING PROPERTY ATTRIBUTES PowerShell includes several attribute classes that you can use to enhance data type information and validate the data assigned to a property. Validation @@ -642,7 +642,7 @@ requirements. Validation is triggered the moment that the value is assigned. For more information on available attributes, see [about_Functions_Advanced_Parameters][09]. -## Defining instance properties with Update-TypeData +## DEFINING INSTANCE PROPERTIES WITH UPDATE-TYPEDATA Beyond declaring properties directly in the class definition, you can define properties for instances of a class in the static constructor using the @@ -914,7 +914,7 @@ The updated size is: 2, Medium The final size is: 3, Large ``` -## Limitations +## LIMITATIONS PowerShell class properties have the following limitations: @@ -942,7 +942,7 @@ PowerShell class properties have the following limitations: Workaround: None -## See also +## SEE ALSO - [about_Classes][10] - [about_Classes_Constructors][11] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 9815983d7e4e..c9ee334a8357 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -8,11 +8,11 @@ title: about_Command_Precedence --- # about_Command_Precedence -## Short description +## SHORT DESCRIPTION Describes how PowerShell determines which command to run. -## Long description +## LONG DESCRIPTION Command precedence describes how PowerShell determines which command to run when a session contains more than one command with the same name. Commands @@ -20,7 +20,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command precedence +## COMMAND PRECEDENCE When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run using the following rules. @@ -72,7 +72,7 @@ For example, if your session contains a cmdlet and a function, both named > executable. It's only when no external executable is found that an alias, > function, or cmdlet with the given name is invoked. -## Resolving items with the same names +## RESOLVING ITEMS WITH THE SAME NAMES As a result of these rules, items can be replaced or hidden by items with the same name. @@ -94,7 +94,7 @@ with a module name. If you create a function at the command line and then import a function with the same name, the original function is replaced. -## Finding hidden commands +## FINDING HIDDEN COMMANDS The **All** parameter of the [Get-Command][10] cmdlet gets all commands with the specified name, even if they're hidden or replaced. Beginning in PowerShell @@ -251,7 +251,7 @@ $myMap = (Get-Command -Name map -CommandType Function) & ($myMap) ``` -## Replaced items +## REPLACED ITEMS A _replaced_ item is one that you can no longer access. You can replace items by importing items of the same name from a module. @@ -264,7 +264,7 @@ Variables and aliases can't be hidden because you can't use a call operator or a qualified name to run them. When you import variables and aliases from a module, they replace variables in the session with the same name. -## Cmdlet name resolution +## CMDLET NAME RESOLUTION When you don't use the qualified name of a cmdlet, PowerShell checks to see if the cmdlet is loaded in the current session. If there are multiple modules @@ -278,7 +278,7 @@ environment variable. The paths are searched in the order that they're listed in the variable. Within each path, the modules are searched in alphabetical order. PowerShell uses the cmdlet from the first match it finds. -## Avoiding name conflicts +## AVOIDING NAME CONFLICTS The best way to manage command name conflicts is to prevent them. When you name your commands, use a unique name. For example, add your initials or company @@ -297,7 +297,7 @@ For example, the following command avoids any conflict with the `Get-Date` and Import-Module -Name DateFunctions -Prefix ZZ ``` -## Running external executables +## RUNNING EXTERNAL EXECUTABLES On Windows. PowerShell treats the file extensions listed in the `$Env:PATHEXT` environment variable as executable files. Files that aren't Windows executables @@ -314,7 +314,7 @@ the [ftype][04] command. For PowerShell to see a file extension as executable in the current session, you must add the extension to the `$Env:PATHEXT` environment variable. -## See also +## SEE ALSO - [about_Aliases][06] - [about_Functions][07] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Syntax.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Syntax.md index f721dcd1e950..1b6d65a9c885 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Syntax.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Syntax.md @@ -8,16 +8,16 @@ title: about_Command_Syntax --- # about_Command_Syntax -## Short description +## SHORT DESCRIPTION Describes the syntax diagrams that are used in PowerShell. -## Long description +## LONG DESCRIPTION The [Get-Help][03] and [Get-Command][02] cmdlets display syntax diagrams to help you construct commands correctly. This article explains how to interpret the syntax diagrams. -## Get the syntax for a command +## GET THE SYNTAX FOR A COMMAND There are two ways to get the syntax for a command: `Get-Help` and `Get-Command`. @@ -93,7 +93,7 @@ The output of `Get-Help` is slightly different from the output of parameter. `Get-Command` shows the parameter type as the `[CommandTypes]` enumeration, while `Get-Help` show the possible values for the enumeration. -## Parameter Sets +## PARAMETER SETS The parameters of a PowerShell command are listed in parameter sets. A PowerShell command can have one or more parameter sets. The `Get-Command` @@ -144,7 +144,7 @@ example, if you use `Get-Random` without parameters, PowerShell assumes that you're using the **RandomNumberParameterSet** parameter set and it returns a random number. -## Symbols in Syntax Diagrams +## SYMBOLS IN SYNTAX DIAGRAMS The syntax diagram lists the command name, the command parameters, and the parameter values. @@ -263,7 +263,7 @@ The syntax diagrams use the following symbols: New-Alias -Option ReadOnly ``` -## See also +## SEE ALSO - [about_Parameters][01] - [Get-Command][02] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Comment_Based_Help.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Comment_Based_Help.md index f49756982b8f..16cba68568d4 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Comment_Based_Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Comment_Based_Help.md @@ -9,10 +9,11 @@ title: about_Comment_Based_Help --- # about_Comment_Based_Help -## Short description +## SHORT DESCRIPTION + Describes how to write comment-based help content for functions and scripts. -## Long description +## LONG DESCRIPTION You can write comment-based help content for functions and scripts by using special help comment keywords. @@ -35,7 +36,7 @@ information about how to display help content for functions and scripts, see The [Update-Help][08] and [Save-Help][07] cmdlets work only on XML files. Updatable Help doesn't support comment-based help content. -## Syntax for comment-based help +## SYNTAX FOR COMMENT-BASED HELP To create Comment-based help content, you can use either style of comments: single-line comments or block comments. @@ -85,7 +86,7 @@ as `.EXAMPLE`, can appear many times in the same comment block. The help content for each keyword begins on the line after the keyword and can span multiple lines. -## Syntax for comment-based help in functions +## SYNTAX FOR COMMENT-BASED HELP IN FUNCTIONS Comment-based help for a function can appear in one of three locations: @@ -130,7 +131,7 @@ or function Get-Function { } ``` -## Syntax for comment-based help in scripts +## SYNTAX FOR COMMENT-BASED HELP IN SCRIPTS Comment-based help for a script can appear in one of the following two locations in the script. @@ -167,7 +168,7 @@ function Get-Function { } #> ``` -## Comment-based help keywords +## COMMENT-BASED HELP KEYWORDS The following are valid comment-based help keywords. These keywords can appear in any order in the comment-based help, and they aren't case-sensitive. The @@ -345,7 +346,7 @@ as it does in a module directory. For more information about the cmdlet help XML-based help file format, see [How to Write Cmdlet Help][01]. -## Autogenerated content +## AUTOGENERATED CONTENT The name, syntax, parameter list, parameter attribute table, common parameters, and remarks are automatically generated by the `Get-Help` cmdlet. @@ -396,7 +397,7 @@ script. To help users, provide this information in the parameter description. The **Remarks** section of the help topic is automatically generated from the function or script name. You can't change or affect its content. -## Examples +## EXAMPLES ### Comment-based Help for a Function @@ -837,7 +838,7 @@ Displays information about PowerShell cmdlets and concepts. ... ``` -## See also +## SEE ALSO - [about_Functions][04] - [about_Functions_Advanced_Parameters][03] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Comments.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Comments.md index c156396c9221..3c798a68579b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Comments.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Comments.md @@ -8,11 +8,11 @@ title: about_Comments --- # about_Comments -## Short description +## SHORT DESCRIPTION Describes how to use PowerShell comments and lists special use cases. -## Long description +## LONG DESCRIPTION You can write comments to annotate or structure your PowerShell code to help with readability. When your code is run, comment text is ignored by PowerShell. @@ -27,7 +27,7 @@ comments for the following purposes: Some comments have special meaning in PowerShell. See [Special comments][04]. -## PowerShell comment styles +## POWERSHELL COMMENT STYLES PowerShell supports two comment styles: @@ -45,7 +45,7 @@ PowerShell supports two comment styles: > can't nest block comments. If you attempt to nest block comments, the outer > block comment ends at the first `#>` encountered. -## Examples +## EXAMPLES ### Example 1: Single-line comment @@ -99,7 +99,7 @@ $var.Where( ) ``` -## Special comments +## SPECIAL COMMENTS PowerShell includes several comment keywords to support specific uses. @@ -177,7 +177,7 @@ comments. For more information, see the _Folding_ section of the [Basic editing in Visual Studio Code][11] documentation. -## Comments in string tokens +## COMMENTS IN STRING TOKENS `#` and `<# #>` don't have special meaning within an [expandable][06] or [verbatim][07] string. PowerShell interprets the characters literally. @@ -322,7 +322,7 @@ beginning with `#` as comments. For more information, see: - [Example 3: Convert a here-string containing a comment][18] -## Notes +## NOTES - Block comments can't be nested. In the following example, `Baz` is not a part of the comment. 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 2189f71105d7..cbcbbd504596 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -9,11 +9,11 @@ title: about_CommonParameters --- # about_CommonParameters -## Short description +## SHORT DESCRIPTION Describes the parameters that can be used with any cmdlet. -## Long description +## LONG DESCRIPTION The common parameters are a set of cmdlet parameters that you can use with any cmdlet. They're implemented by PowerShell, not by the cmdlet developer, and @@ -73,7 +73,7 @@ The risk mitigation parameters are: - `WhatIf` (wi) - `Confirm` (cf) -## Common parameter descriptions +## COMMON PARAMETER DESCRIPTIONS ### -Debug @@ -676,7 +676,7 @@ from specific commands. You can use array notation, such as `$a[0]` or > The warning variable contains all warnings generated by the command, > including warnings from calls to nested functions or scripts. -## Risk Management Parameter Descriptions +## RISK MANAGEMENT PARAMETER DESCRIPTIONS ### -WhatIf @@ -818,7 +818,7 @@ Mode LastWriteTime Length Name -a--- 8/27/2010 2:41 PM 0 test.txt ``` -## See also +## SEE ALSO - [about_Preference_Variables][03] - [Write-Debug][11] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md index 21d733b1a9d6..5e5a846e9b9d 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md @@ -8,12 +8,12 @@ title: about_Comparison_Operators --- # about_Comparison_Operators -## Short description +## SHORT DESCRIPTION The comparison operators in PowerShell can either compare two values or filter elements of a collection against an input value. -## Long description +## LONG DESCRIPTION Comparison operators let you compare values or finding values that match specified patterns. PowerShell includes the following comparison operators: @@ -52,7 +52,7 @@ specified patterns. PowerShell includes the following comparison operators: - `-is` - both objects are the same type - `-isnot` - the objects aren't the same type -## Common features +## COMMON FEATURES String comparisons are case-insensitive unless you use the explicit case-sensitive operator. To make a comparison operator case-sensitive, add a @@ -93,7 +93,7 @@ There are a few exceptions: - The `-match` and `-notmatch` operators also populate the `$Matches` automatic variable unless the left-hand side of the expression is a collection. -## Equality operators +## EQUALITY OPERATORS ### -eq and -ne @@ -343,7 +343,7 @@ $a -gt 'a' If the two sides of the operators aren't reasonably comparable, these operators raise a non-terminating error. -## Matching operators +## MATCHING OPERATORS The matching operators (`-like`, `-notlike`, `-match`, and `-notmatch`) find elements that match or don't match a specified pattern. The pattern for `-like` @@ -513,7 +513,7 @@ if ('1.0.0' -match '(.*?)') { For details, see [about_Regular_Expressions][10] and [about_Automatic_Variables][06]. -## Replacement operator +## REPLACEMENT OPERATOR ### Replacement with regular expressions @@ -622,7 +622,7 @@ a4 a5 ``` -## Containment operators +## CONTAINMENT OPERATORS The containment operators (`-contains`, `-notcontains`, `-in`, and `-notin`) are similar to the equality operators, except that they always return a @@ -731,7 +731,7 @@ $a -in '$a', 'ghi' # Output: True $a -in 'abc def', 'ghi' # Output: True ``` -## Type comparison +## TYPE COMPARISON The type comparison operators (`-is` and `-isnot`) are used to determine if an object is a specific type. @@ -754,7 +754,7 @@ $b -isnot [int] # Output: True $a -isnot $b.GetType() # Output: True ``` -## See also +## SEE ALSO - [about_Booleans][07] - [about_Operators][08] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Continue.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Continue.md index 63807a23ccc1..61284214f94b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Continue.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Continue.md @@ -8,18 +8,18 @@ title: about_Continue --- # about_Continue -## Short description +## SHORT DESCRIPTION Describes how the `continue` statement immediately returns the program flow to the top of a program loop, a `switch` statement, or a `trap` statement. -## Long description +## LONG DESCRIPTION The `continue` statement provides a way to exit the current control block but continue execution, rather than exit completely. The statement supports labels. A label is a name you assign to a statement in a script. -## Using continue in loops +## USING CONTINUE IN LOOPS An unlabeled `continue` statement immediately returns the program flow to the top of the innermost loop that is controlled by a `for`, `foreach`, `do`, @@ -85,7 +85,7 @@ is **True** and iteration continues with the second `for` loop at `labelB`. } ``` -## Using continue in a switch statement +## USING CONTINUE IN A SWITCH STATEMENT An unlabeled `continue` statement within a `switch` terminates execution of the current `switch` iteration and transfers control to the top of the `switch` to @@ -108,13 +108,13 @@ switch (1,2,3) { 3 ``` -## Using continue in a trap statement +## USING CONTINUE IN A TRAP STATEMENT If the final statement executed in the body a `trap` statement is `continue`, the trapped error is silently ignored and execution continues with the statement immediately following the one that caused `trap` to occur. -## Do not use continue outside of a loop, switch, or trap +## DO NOT USE CONTINUE OUTSIDE OF A LOOP, SWITCH, OR TRAP When `continue` is used outside of a construct that directly supports it (loops, `switch`, `trap`), PowerShell looks _up the call stack_ for an @@ -128,7 +128,7 @@ their _callers_. Using `continue` inside a pipeline, such as a `ForEach-Object` script block, not only exits the pipeline, it potentially terminates the entire runspace. -## See also +## SEE ALSO - [about_Break](about_Break.md) - [about_Comparison_Operators](about_Comparison_Operators.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Core_Commands.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Core_Commands.md index 99e217b7ba94..293c51e81672 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Core_Commands.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Core_Commands.md @@ -9,11 +9,11 @@ title: about_Core_Commands # about_Core_Commands -## Short description +## SHORT DESCRIPTION Lists the cmdlets that are designed for use with PowerShell providers. -## Long description +## LONG DESCRIPTION PowerShell includes a set of cmdlets that are specifically designed to manage the items in the data stores that are exposed by Windows PowerShell providers. @@ -89,6 +89,6 @@ PSProvider cmdlets For more information about a cmdlet, type `Get-Help `. -## See also +## SEE ALSO - [about_Providers](about_Providers.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Files.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Files.md index 4008bd891bcc..9fdb6932d1f6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Files.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Data_Files.md @@ -8,23 +8,23 @@ title: about_Data_Files --- # about_Data_Files -## Short description +## SHORT DESCRIPTION PowerShell data files are used to store arbitrary data using PowerShell syntax. -## Long description +## LONG DESCRIPTION PowerShell data (`.psd1`) files can store arbitrary data in PowerShell syntax. That data can be imported into variables in a PowerShell session. PowerShell has three types of data files and provides a cmdlet to import each type. -## Basic data files +## BASIC DATA FILES The `Import-PowerShellDataFile` cmdlet imports basic data files. The data in the file must be contained in a hashtable. This format only supports constant values. You can't use code or PowerShell expressions. -## Module manifests +## MODULE MANIFESTS Module manifests are PowerShell data files. The data in the file must be contained in a hashtable. The structure of that hashtable only supports @@ -40,7 +40,7 @@ that can be used. For more information, see [about_Module_Manifests][03]. -## Localized data +## LOCALIZED DATA The `Import-LocalizedData` cmdlet imports localized data files. During import, the file is processed in `Constrained` language mode. `Constrained` mode limits @@ -59,7 +59,7 @@ supported by the PowerShell syntax, such as `data` sections. For more information, see [about_Data_Sections][01]. -## See also +## SEE ALSO - [Import-LocalizedData][05] - [Import-Module][04] 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 b285bb96135f..062ab36d7d86 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 @@ -8,12 +8,12 @@ title: about_Data_Sections --- # about_Data_Sections -## Short description +## SHORT DESCRIPTION Explains `data` sections, which isolate text strings and other read-only data from script logic. -## Long description +## LONG DESCRIPTION Scripts that are designed for PowerShell can have one or more `data` sections that contain only data. You can include one or more `data` sections in any @@ -199,7 +199,7 @@ data -SupportedCommand Format-Xml { } ``` -## See also +## SEE ALSO - [about_Automatic_Variables][01] - [about_Comparison_Operators][02] 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 a46b486c7328..cd5eec328cd3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -8,11 +8,11 @@ title: about_Debuggers --- # about_Debuggers -## Short description +## SHORT DESCRIPTION Describes the PowerShell debugger. -## Long description +## LONG DESCRIPTION Debugging is the process of examining a script while it's running to identify and correct errors in the script instructions. The PowerShell debugger can help @@ -31,7 +31,7 @@ in either the console or Windows PowerShell Integrated Scripting Environment > PowerShell. For more information, see > [Debugging with Visual Studio Code][01]. -## Debugger cmdlets +## DEBUGGER CMDLETS The PowerShell debugger includes the following set of cmdlets: @@ -42,7 +42,7 @@ The PowerShell debugger includes the following set of cmdlets: - `Remove-PSBreakpoint`: Deletes breakpoints from the current session. - `Get-PSCallStack`: Displays the current call stack. -## Starting and stopping the debugger +## STARTING AND STOPPING THE DEBUGGER To start the debugger, set one or more breakpoints then run the script, command, or function that you want to debug. @@ -53,7 +53,7 @@ debugger. To stop the debugger, run the script, command, or function until it's complete. Or, type `stop` or `t`. -## Debugger commands +## DEBUGGER COMMANDS When you use the debugger in the PowerShell console, use the following commands to control the execution. In Windows PowerShell ISE, use commands on the Debug @@ -117,7 +117,7 @@ continue running the script until you have identified a problem. > If you step into a statement with a redirection operator, such as `>`, the > PowerShell debugger steps over all remaining statements in the script. -## Displaying the values of script variables +## DISPLAYING THE VALUES OF SCRIPT VARIABLES While you are in the debugger, you can also enter commands, display the value of variables, use cmdlets, and run scripts at the command line. You can display @@ -148,7 +148,7 @@ $scriptArgs = $args $scriptname = $MyInvocation.PSCommandPath ``` -## The debugger environment +## THE DEBUGGER ENVIRONMENT When you reach a breakpoint, you enter the debugger environment. The command prompt changes so that it begins with "[DBG]:". Also, in some host @@ -179,7 +179,7 @@ Name CommandLineParameters UnboundArguments Location = {} {} C:\ps-test\vote.ps1 (1) ``` -## Debugging and scope +## DEBUGGING AND SCOPE Breaking into the debugger doesn't change the scope in which you are operating, but when you reach a breakpoint in a script, you move into the script scope. @@ -198,7 +198,7 @@ Get-Variable -Scope 0 This is a useful way to see only the variables that you defined in the script and that you defined while debugging. -## Debugging at the command line +## DEBUGGING AT THE COMMAND LINE When you set a variable breakpoint or a command breakpoint, you can set the breakpoint only in a script file. However, by default, the breakpoint is set on @@ -215,7 +215,7 @@ in the user's profile. Line breakpoints are specific to script files, so they're set only in script files. -## Debugging workflows +## DEBUGGING WORKFLOWS The debugger can be used to debug PowerShell workflows, either in the PowerShell console, or in Windows PowerShell ISE. There are some limitations @@ -300,7 +300,7 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName Workflow function complete. ``` -## Debugging functions +## DEBUGGING FUNCTIONS When you set a breakpoint on a function that has `begin`, `process`, and `end` sections, the debugger breaks at the first line of each section. @@ -350,7 +350,7 @@ Test-Cmdlet [DBG]: C:\PS> ``` -## Debugging remote scripts +## DEBUGGING REMOTE SCRIPTS You can run `Enter-PSSession` to start an interactive remote PowerShell session in which you can set breakpoints and debug script files and commands on the @@ -419,7 +419,7 @@ At C:\psscripts\ttest19.ps1:12 char:1 PS C:\psscripts> ``` -## Examples +## EXAMPLES This test script detects the version of PowerShell and displays a version-appropriate message. It includes a function, a function call, and a @@ -754,7 +754,7 @@ DBG> k This example demonstrates just a few of the many ways to use the PowerShell debugger. -## Other Debugging Features in PowerShell +## OTHER DEBUGGING FEATURES IN POWERSHELL In addition to the PowerShell debugger, PowerShell includes several other features that you can use to debug scripts and functions. @@ -772,7 +772,7 @@ features that you can use to debug scripts and functions. the Write verb for this task, such as `Write-Host`, `Write-Debug`, `Write-Warning`, and `Write-Verbose`. -## See also +## SEE ALSO - [Disable-PSBreakpoint][05] - [Enable-PSBreakpoint][06] diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md index 1a508d4a049e..53b795621b79 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md @@ -9,12 +9,12 @@ title: about_DesiredStateConfiguration # about_DesiredStateConfiguration -## Short description +## SHORT DESCRIPTION Provides a brief introduction to the PowerShell Desired State Configuration (DSC) feature. -## Long description +## LONG DESCRIPTION DSC is a management platform in PowerShell that enables deploying and managing configuration data for software services, and managing the environment in @@ -168,7 +168,7 @@ that have been created by the PowerShell and DSC user community, and by Microsoft. Visit the [PowerShell Gallery](https://www.powershellgallery.com/) to browse and learn about available DSC resources. -## See also +## SEE ALSO - [PowerShell Desired State Configuration Overview](/powershell/scripting/dsc/overview/) - [Built-In PowerShell Desired State Configuration Resources](/powershell/scripting/dsc/resources/resources) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Do.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Do.md index cdcb94c067f8..e2b1480ee70c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Do.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Do.md @@ -8,11 +8,11 @@ title: about_Do --- # about_Do -## Short description +## SHORT DESCRIPTION Runs a statement list one or more times, subject to a `while` or `until` condition. -## Long description +## LONG DESCRIPTION The `do` keyword works with the `while` keyword or the `until` keyword to run the statements in a script block, subject to a condition. Unlike the related @@ -83,7 +83,7 @@ do { while (++$a -lt 10) ``` -## See also +## SEE ALSO - [about_Booleans](about_Booleans.md) - [about_Break](about_Break.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Enum.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Enum.md index a64c86a1618d..2c5c4be111b1 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Enum.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Enum.md @@ -8,13 +8,13 @@ title: about_Enum --- # about_Enum -## Short description +## SHORT DESCRIPTION The `enum` statement declares an enumeration. An enumeration is a distinct type that consists of a set of named labels called the enumerator list. -## Long description +## LONG DESCRIPTION The `enum` statement allows you to create a strongly typed set of labels. You can use that enumeration in the code without having to parse or check for @@ -26,7 +26,7 @@ value of zero. By default, PowerShell enumerations use **System.Int32** label in the list the value zero. By default, PowerShell assigns the remaining labels with consecutive integers. -## Syntax +## SYNTAX In the definition, you can give labels any integer value. Labels with no value assigned take the next integer value. @@ -67,7 +67,7 @@ Enumerations use the following syntaxes: []::