|
| 1 | +--- |
| 2 | +ms.date: 01/05/2026 |
| 3 | +--- |
| 4 | +# Terminology guidelines |
| 5 | + |
| 6 | +When writing about PowerShell, use the following terminology guidelines to ensure consistency across |
| 7 | +documentation. This is a draft document that's subject to change. Eventually, this content will be |
| 8 | +moved to the PowerShell-Docs Style Guide. |
| 9 | + |
| 10 | +## Null values |
| 11 | + |
| 12 | +See [null, NULL, Null - Microsoft Style Guide][04]. |
| 13 | + |
| 14 | +Use lowercase _null_ to refer to a null value. Better yet, use _null value_ to avoid confusion with |
| 15 | +the constant. |
| 16 | + |
| 17 | +Use `$null`, `NULL`, or `Null` (depending on the language context) only to refer to the constant. |
| 18 | +Use `DBNull` to refer to the `[System.DBNull]` type. |
| 19 | + |
| 20 | +## Boolean values |
| 21 | + |
| 22 | +Use _FALSE_ or _TRUE_ (all uppercase) to refer to boolean values in general writing. Use `$true` and |
| 23 | +`$false` (all lowercase) when referring to the boolean constants. |
| 24 | + |
| 25 | +## Hash tables |
| 26 | + |
| 27 | +- Use _hash table_ (two words, all lowercase) to refer to the computer science concept in general |
| 28 | + writing. See [Hash table - Wikipedia][07]. |
| 29 | +- Use _hashtable_ (all lowercase) when referring to the PowerShell objects of type `[hashtable]`. |
| 30 | + May be capitalized as _Hashtable_ when it begins a sentence. |
| 31 | +- `[hashtable]` (with backticks) when referring to the type more specifically. |
| 32 | +- Full type names should match the .NET definition: `[System.Collections.Hashtable]` |
| 33 | + |
| 34 | +## PowerShell language keywords |
| 35 | + |
| 36 | +All keywords should be lowercase and backticked in a paragraph. See [about_Language_Keywords][01]. |
| 37 | +When referring to control flow statements that have multiple keywords, use slashes to separate the |
| 38 | +keywords rather than spaces or dashes. |
| 39 | + |
| 40 | +- `do/until` |
| 41 | +- `do/while` |
| 42 | +- `try/catch/finally` |
| 43 | +- `if/elseif/elseif` |
| 44 | + |
| 45 | +Example: |
| 46 | + |
| 47 | +> A `do/until` loop consists of a `do` statement block followed by an `until` statement block |
| 48 | +> containing a condition. |
| 49 | +
|
| 50 | +## Hyphenation |
| 51 | + |
| 52 | +See [Hyphens - Microsoft Style Guide][06]. |
| 53 | + |
| 54 | +In general, don't include a hyphen after prefixes unless omitting the hyphen could confuse the |
| 55 | +reader. See the style guide for specific examples. |
| 56 | + |
| 57 | +- _subexpression_ not _sub-expression_ |
| 58 | + |
| 59 | +Hyphenate two or more words that precede and modify a noun. |
| 60 | + |
| 61 | +- dot-source |
| 62 | + |
| 63 | + Use the _dot-source operator_ to _dot-source_ a script. |
| 64 | + |
| 65 | +- _built-in_ drive |
| 66 | +- _high-level-language_ compiler |
| 67 | +- _member-access_ operator |
| 68 | + |
| 69 | +## Declare vs. initialize |
| 70 | + |
| 71 | +PowerShell has no concept of declaring variables, unless you count using `New-Variable` and a |
| 72 | +declaration. Even then the new variable it given a default value. Essentially, variables are |
| 73 | +declared on first use. If the variable was not assigned a value, it is initialized to a default |
| 74 | +value depending on its type. |
| 75 | + |
| 76 | +_Initialize_ is the correct term to use when referring to assigning a value to a variable for the |
| 77 | +first time. |
| 78 | + |
| 79 | +## Native vs. external commands |
| 80 | + |
| 81 | +Not all external commands are native commands. A PowerShell script can be an _external command_, but |
| 82 | +it is not a native command. |
| 83 | + |
| 84 | +_Native commands_ are executables that can be run from any shell or other invocation method |
| 85 | +supported by the OS. |
| 86 | + |
| 87 | +## Scalar vs. single vs. singleton |
| 88 | + |
| 89 | +See [Scalar data type - Wikipedia][08]. |
| 90 | + |
| 91 | +A scalar data type, or just scalar, is any non-composite value. |
| 92 | + |
| 93 | +Generally, all basic primitive data types are considered scalar: |
| 94 | + |
| 95 | +- The Boolean data type (bool) |
| 96 | +- Numeric types (int, the floating point types float and double) |
| 97 | +- Character types (char) |
| 98 | + |
| 99 | +The term _single_ should only refer to a single-precision floating point type `[single]`. |
| 100 | + |
| 101 | +A _singleton_ is a single instance of an object that may be scalar or complex. |
| 102 | + |
| 103 | +## Capitalization and space conventions |
| 104 | + |
| 105 | +For general guidelines, see [Capitalization - Microsoft Style Guide][05]. For PowerShell: |
| 106 | + |
| 107 | +- Language keywords are always lowercase. |
| 108 | +- Cmdlet names and parameters usually use PascalCase, but verify the correct casing by inspecting |
| 109 | + the commands. |
| 110 | + |
| 111 | +Microsoft product names have specific capitalization requirements that must be followed. See |
| 112 | +[Microsoft Product Style Guide][03]. |
| 113 | + |
| 114 | +### Specific terms |
| 115 | + |
| 116 | +- _filesystem_ - no space |
| 117 | +- _filename_ - no space |
| 118 | +- _localhost_ - lowercase |
| 119 | +- _CIM session_ - refers to the concept of a CIM session |
| 120 | +- _CimSession_ - refers to the PowerShell object of type `[CimSession]` |
| 121 | +- _PSSnapin_ - refers to an instance of a PowerShell snap-in assembly (such as |
| 122 | + Microsoft.PowerShell.Core) |
| 123 | +- _snap-in_ - the general term for a PowerShell snap-in assembly |
| 124 | +- _SDDL_ - abbreviation of Security Descriptor Definition Language |
| 125 | +- _WSMan_ and _WinRM_ |
| 126 | + - _WSMan_ - Microsoft's abbreviation for the WS-Management (Web Services-Management) open standard |
| 127 | + - _WinRM_ - Windows Remote Management - Microsoft's implementation of the WSMan standard |
| 128 | + - Use lowercase instances only where the name is lowercase in the service interfaces (such as |
| 129 | + `winrm` command-line tool, or in schema URIs and other properties). |
| 130 | +- Variable scopes and scope modifiers |
| 131 | + |
| 132 | + See [Appendix A - Grammar - B.1.6 Variables][02] |
| 133 | + |
| 134 | + Scope names and modifiers are all PascalCase: |
| 135 | + |
| 136 | + - `Global:` |
| 137 | + - `Local:` |
| 138 | + - `Private:` |
| 139 | + - `Script:` |
| 140 | + - `Using:` |
| 141 | + - `Workflow:` |
| 142 | + |
| 143 | +<!-- link references --> |
| 144 | +[01]: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_keywords |
| 145 | +[02]: https://learn.microsoft.com/powershell/scripting/lang-spec/chapter-15#b16-variables |
| 146 | +[03]: https://learn.microsoft.com/product-style-guide-msft-internal/welcome/ |
| 147 | +[04]: https://learn.microsoft.com/style-guide/a-z-word-list-term-collections/n/null |
| 148 | +[05]: https://learn.microsoft.com/style-guide/capitalization |
| 149 | +[06]: https://learn.microsoft.com/style-guide/punctuation/dashes-hyphens/hyphens |
| 150 | +[07]: https://wikipedia.org/wiki/Hash_table |
| 151 | +[08]: https://wikipedia.org/wiki/Scalar_processor#Scalar_data_type |
0 commit comments