Skip to content

Commit 6d6f7bb

Browse files
surfingoldelephantsdwheeler
authored andcommitted
Minor formatting changes to about_Language_Modes
1 parent 0a928c6 commit 6d6f7bb

File tree

4 files changed

+68
-41
lines changed

4 files changed

+68
-41
lines changed

reference/5.1/Microsoft.PowerShell.Core/About/about_Language_Modes.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ For example:
5050

5151
```powershell
5252
$ExecutionContext.SessionState.LanguageMode
53+
```
54+
55+
```Output
5356
ConstrainedLanguage
5457
```
5558

5659
However, in sessions with `RestrictedLanguage` and `NoLanguage` modes, you
5760
can't use the [member-access operator][02] (`.`) to get property values.
5861
Instead, the error message reveals the language mode.
5962

60-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
63+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
6164
`RestrictedLanguage` session, PowerShell returns the
6265
**PropertyReferenceNotSupportedInDataSection** and
6366
**VariableReferenceNotSupportedInDataSection** error messages.
@@ -68,8 +71,9 @@ When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
6871
referenced in restricted language mode or a Data section is being
6972
referenced.
7073

71-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
72-
NoLanguage session, PowerShell returns the **ScriptsNotAllowed** error message.
74+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
75+
`NoLanguage` session, PowerShell returns the **ScriptsNotAllowed** error
76+
message.
7377

7478
- **ScriptsNotAllowed**: The syntax isn't supported by this runspace. This
7579
might be because it's in no-language mode.
@@ -82,6 +86,9 @@ language mode by getting the value of the **LanguageMode** property.
8286

8387
```powershell
8488
(Get-PSSessionConfiguration -Name Test).LanguageMode
89+
```
90+
91+
```Output
8592
FullLanguage
8693
```
8794

@@ -117,11 +124,10 @@ application control policy. For example, there are additional restrictions to
117124
dot-sourcing and module importing under a policy.
118125

119126
When a PowerShell session is started under a policy, it runs in
120-
`ConstrainedLanguage` mode. This mode allows for a usable interactive shell
121-
experience while limiting access to features and APIs that could be abused by a
122-
malicious actor. Users can run cmdlets and native commands and have access to
123-
basic language elements. Access to PowerShell, .NET, and COM APIs is
124-
restricted.
127+
`ConstrainedLanguage` mode. This mode allows users to have a usable interactive
128+
shell experience, running cmdlets and native commands, as well as access to
129+
basic language elements. But the user can't access PowerShell, .NET, or COM
130+
APIs that could be abused by a malicious actor.
125131

126132
Any script or script-based module executed in this session runs in
127133
`ConstrainedLanguage` mode. However, any script or script-based module allowed
@@ -146,13 +152,13 @@ For more information, see [JEA Session configurations][01] and
146152

147153
This section describes the language modes in PowerShell sessions.
148154

149-
### FullLanguage mode
155+
### `FullLanguage` mode
150156

151157
The `FullLanguage` mode permits all language elements in the session.
152158
`FullLanguage` is the default language mode for default sessions on all
153159
versions of Windows.
154160

155-
### RestrictedLanguage mode
161+
### `RestrictedLanguage` mode
156162

157163
In `RestrictedLanguage` mode, users can run commands (cmdlets, functions, CIM
158164
commands, and workflows), but can't use script blocks. This mode is also used
@@ -176,7 +182,7 @@ additional variables:
176182
- `$PSScriptRoot`
177183
- `$PSEdition`
178184
- `$EnabledExperimentalFeatures`
179-
- Any environment variables, like `$Env:TEMP`
185+
- Any environment variable, like `$env:TEMP`
180186

181187
Only the following comparison operators are permitted:
182188

@@ -186,7 +192,7 @@ Only the following comparison operators are permitted:
186192

187193
Assignment statements, property references, and method calls aren't permitted.
188194

189-
### ConstrainedLanguage mode
195+
### `ConstrainedLanguage` mode
190196

191197
`ConstrainedLanguage` mode is designed to allow basic language elements such as
192198
loops, conditionals, string expansion, and access to object properties. The
@@ -221,7 +227,7 @@ The features of `ConstrainedLanguage` mode are as follows:
221227
The following .NET types are permitted in `ConstrainedLanguage` mode. Users can
222228
get properties, invoke methods, and convert objects to these types.
223229

224-
Allowed Types:
230+
Allowed types:
225231

226232
- `[adsi]`
227233
- `[adsisearcher]`
@@ -318,7 +324,7 @@ Special cases:
318324
`[Management.Automation.PSReference]` is not permitted. Other uses are
319325
permitted.
320326

321-
### NoLanguage mode
327+
### `NoLanguage` mode
322328

323329
PowerShell `NoLanguage` mode disables PowerShell scripting language completely.
324330
You can't run scripts or use variables. You can only run native commands and

reference/7.4/Microsoft.PowerShell.Core/About/about_Language_Modes.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ For example:
5353

5454
```powershell
5555
$ExecutionContext.SessionState.LanguageMode
56+
```
57+
58+
```Output
5659
ConstrainedLanguage
5760
```
5861

5962
However, in sessions with `RestrictedLanguage` and `NoLanguage` modes, you
6063
can't use the [member-access operator][02] (`.`) to get property values.
6164
Instead, the error message reveals the language mode.
6265

63-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
66+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
6467
`RestrictedLanguage` session, PowerShell returns the
6568
**PropertyReferenceNotSupportedInDataSection** and
6669
**VariableReferenceNotSupportedInDataSection** error messages.
@@ -71,8 +74,9 @@ When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
7174
referenced in restricted language mode or a Data section is being
7275
referenced.
7376

74-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
75-
NoLanguage session, PowerShell returns the **ScriptsNotAllowed** error message.
77+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
78+
`NoLanguage` session, PowerShell returns the **ScriptsNotAllowed** error
79+
message.
7680

7781
- **ScriptsNotAllowed**: The syntax isn't supported by this runspace. This
7882
might be because it's in no-language mode.
@@ -85,6 +89,9 @@ language mode by getting the value of the **LanguageMode** property.
8589

8690
```powershell
8791
(Get-PSSessionConfiguration -Name Test).LanguageMode
92+
```
93+
94+
```Output
8895
FullLanguage
8996
```
9097

@@ -149,13 +156,13 @@ For more information, see [JEA Session configurations][01] and
149156

150157
This section describes the language modes in PowerShell sessions.
151158

152-
### FullLanguage mode
159+
### `FullLanguage` mode
153160

154161
The `FullLanguage` mode permits all language elements in the session.
155162
`FullLanguage` is the default language mode for default sessions on all
156163
versions of Windows.
157164

158-
### RestrictedLanguage mode
165+
### `RestrictedLanguage` mode
159166

160167
In `RestrictedLanguage` mode, users can run commands (cmdlets, functions, CIM
161168
commands, and workflows), but can't use script blocks. This mode is also used
@@ -179,7 +186,7 @@ additional variables:
179186
- `$PSScriptRoot`
180187
- `$PSEdition`
181188
- `$EnabledExperimentalFeatures`
182-
- Any environment variables, like `$Env:TEMP`
189+
- Any environment variable, like `$env:TEMP`
183190

184191
Only the following comparison operators are permitted:
185192

@@ -189,7 +196,7 @@ Only the following comparison operators are permitted:
189196

190197
Assignment statements, property references, and method calls aren't permitted.
191198

192-
### ConstrainedLanguage mode
199+
### `ConstrainedLanguage` mode
193200

194201
`ConstrainedLanguage` mode is designed to allow basic language elements such as
195202
loops, conditionals, string expansion, and access to object properties. The
@@ -219,7 +226,7 @@ The features of `ConstrainedLanguage` mode are as follows:
219226
The following .NET types are permitted in `ConstrainedLanguage` mode. Users can
220227
get properties, invoke methods, and convert objects to these types.
221228

222-
Allowed Types:
229+
Allowed types:
223230

224231
- `[adsi]`
225232
- `[adsisearcher]`
@@ -328,7 +335,7 @@ Special cases:
328335
`[Management.Automation.PSReference]` is not permitted. Other uses are
329336
permitted.
330337

331-
### NoLanguage mode
338+
### `NoLanguage` mode
332339

333340
PowerShell `NoLanguage` mode disables PowerShell scripting language completely.
334341
You can't run scripts or use variables. You can only run native commands and

reference/7.5/Microsoft.PowerShell.Core/About/about_Language_Modes.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ For example:
5353

5454
```powershell
5555
$ExecutionContext.SessionState.LanguageMode
56+
```
57+
58+
```Output
5659
ConstrainedLanguage
5760
```
5861

5962
However, in sessions with `RestrictedLanguage` and `NoLanguage` modes, you
6063
can't use the [member-access operator][02] (`.`) to get property values.
6164
Instead, the error message reveals the language mode.
6265

63-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
66+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
6467
`RestrictedLanguage` session, PowerShell returns the
6568
**PropertyReferenceNotSupportedInDataSection** and
6669
**VariableReferenceNotSupportedInDataSection** error messages.
@@ -71,8 +74,9 @@ When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
7174
referenced in restricted language mode or a Data section is being
7275
referenced.
7376

74-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
75-
NoLanguage session, PowerShell returns the **ScriptsNotAllowed** error message.
77+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
78+
`NoLanguage` session, PowerShell returns the **ScriptsNotAllowed** error
79+
message.
7680

7781
- **ScriptsNotAllowed**: The syntax isn't supported by this runspace. This
7882
might be because it's in no-language mode.
@@ -85,6 +89,9 @@ language mode by getting the value of the **LanguageMode** property.
8589

8690
```powershell
8791
(Get-PSSessionConfiguration -Name Test).LanguageMode
92+
```
93+
94+
```Output
8895
FullLanguage
8996
```
9097

@@ -149,13 +156,13 @@ For more information, see [JEA Session configurations][01] and
149156

150157
This section describes the language modes in PowerShell sessions.
151158

152-
### FullLanguage mode
159+
### `FullLanguage` mode
153160

154161
The `FullLanguage` mode permits all language elements in the session.
155162
`FullLanguage` is the default language mode for default sessions on all
156163
versions of Windows.
157164

158-
### RestrictedLanguage mode
165+
### `RestrictedLanguage` mode
159166

160167
In `RestrictedLanguage` mode, users can run commands (cmdlets, functions, CIM
161168
commands, and workflows), but can't use script blocks. This mode is also used
@@ -179,7 +186,7 @@ additional variables:
179186
- `$PSScriptRoot`
180187
- `$PSEdition`
181188
- `$EnabledExperimentalFeatures`
182-
- Any environment variables, like `$Env:TEMP`
189+
- Any environment variable, like `$env:TEMP`
183190

184191
Only the following comparison operators are permitted:
185192

@@ -189,7 +196,7 @@ Only the following comparison operators are permitted:
189196

190197
Assignment statements, property references, and method calls aren't permitted.
191198

192-
### ConstrainedLanguage mode
199+
### `ConstrainedLanguage` mode
193200

194201
`ConstrainedLanguage` mode is designed to allow basic language elements such as
195202
loops, conditionals, string expansion, and access to object properties. The
@@ -219,7 +226,7 @@ The features of `ConstrainedLanguage` mode are as follows:
219226
The following .NET types are permitted in `ConstrainedLanguage` mode. Users can
220227
get properties, invoke methods, and convert objects to these types.
221228

222-
Allowed Types:
229+
Allowed types:
223230

224231
- `[adsi]`
225232
- `[adsisearcher]`
@@ -328,7 +335,7 @@ Special cases:
328335
`[Management.Automation.PSReference]` is not permitted. Other uses are
329336
permitted.
330337

331-
### NoLanguage mode
338+
### `NoLanguage` mode
332339

333340
PowerShell `NoLanguage` mode disables PowerShell scripting language completely.
334341
You can't run scripts or use variables. You can only run native commands and

reference/7.6/Microsoft.PowerShell.Core/About/about_Language_Modes.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ For example:
5353

5454
```powershell
5555
$ExecutionContext.SessionState.LanguageMode
56+
```
57+
58+
```Output
5659
ConstrainedLanguage
5760
```
5861

5962
However, in sessions with `RestrictedLanguage` and `NoLanguage` modes, you
6063
can't use the [member-access operator][02] (`.`) to get property values.
6164
Instead, the error message reveals the language mode.
6265

63-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
66+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
6467
`RestrictedLanguage` session, PowerShell returns the
6568
**PropertyReferenceNotSupportedInDataSection** and
6669
**VariableReferenceNotSupportedInDataSection** error messages.
@@ -71,8 +74,9 @@ When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
7174
referenced in restricted language mode or a Data section is being
7275
referenced.
7376

74-
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
75-
NoLanguage session, PowerShell returns the **ScriptsNotAllowed** error message.
77+
When you access `$ExecutionContext.SessionState.LanguageMode` in a
78+
`NoLanguage` session, PowerShell returns the **ScriptsNotAllowed** error
79+
message.
7680

7781
- **ScriptsNotAllowed**: The syntax isn't supported by this runspace. This
7882
might be because it's in no-language mode.
@@ -85,6 +89,9 @@ language mode by getting the value of the **LanguageMode** property.
8589

8690
```powershell
8791
(Get-PSSessionConfiguration -Name Test).LanguageMode
92+
```
93+
94+
```Output
8895
FullLanguage
8996
```
9097

@@ -149,13 +156,13 @@ For more information, see [JEA Session configurations][01] and
149156

150157
This section describes the language modes in PowerShell sessions.
151158

152-
### FullLanguage mode
159+
### `FullLanguage` mode
153160

154161
The `FullLanguage` mode permits all language elements in the session.
155162
`FullLanguage` is the default language mode for default sessions on all
156163
versions of Windows.
157164

158-
### RestrictedLanguage mode
165+
### `RestrictedLanguage` mode
159166

160167
In `RestrictedLanguage` mode, users can run commands (cmdlets, functions, CIM
161168
commands, and workflows), but can't use script blocks. This mode is also used
@@ -179,7 +186,7 @@ additional variables:
179186
- `$PSScriptRoot`
180187
- `$PSEdition`
181188
- `$EnabledExperimentalFeatures`
182-
- Any environment variables, like `$Env:TEMP`
189+
- Any environment variable, like `$env:TEMP`
183190

184191
Only the following comparison operators are permitted:
185192

@@ -189,7 +196,7 @@ Only the following comparison operators are permitted:
189196

190197
Assignment statements, property references, and method calls aren't permitted.
191198

192-
### ConstrainedLanguage mode
199+
### `ConstrainedLanguage` mode
193200

194201
`ConstrainedLanguage` mode is designed to allow basic language elements such as
195202
loops, conditionals, string expansion, and access to object properties. The
@@ -219,7 +226,7 @@ The features of `ConstrainedLanguage` mode are as follows:
219226
The following .NET types are permitted in `ConstrainedLanguage` mode. Users can
220227
get properties, invoke methods, and convert objects to these types.
221228

222-
Allowed Types:
229+
Allowed types:
223230

224231
- `[adsi]`
225232
- `[adsisearcher]`
@@ -328,7 +335,7 @@ Special cases:
328335
`[Management.Automation.PSReference]` is not permitted. Other uses are
329336
permitted.
330337

331-
### NoLanguage mode
338+
### `NoLanguage` mode
332339

333340
PowerShell `NoLanguage` mode disables PowerShell scripting language completely.
334341
You can't run scripts or use variables. You can only run native commands and

0 commit comments

Comments
 (0)