Skip to content

Commit 4ee28d9

Browse files
authored
Merge pull request #4776 from MicrosoftDocs/staging
merge latest changes to live
2 parents 00083f0 + 9d9e50e commit 4ee28d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1742
-1378
lines changed

developer/bread/toc.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
- name: PowerShell
2-
tocHref: /powershell/
3-
topicHref: /powershell/index
1+
- name: Docs
2+
tocHref: /
3+
topicHref: /
44
items:
5-
- name: Developer
6-
tocHref: /powershell/developer/
7-
topicHref: /powershell/developer/index
5+
- name: PowerShell
6+
tocHref: /powershell/
7+
topicHref: /powershell/index
8+
items:
9+
- name: Developer
10+
tocHref: /powershell/developer/
11+
topicHref: /powershell/developer/index

dsc/bread/toc.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
- name: PowerShell
2-
tocHref: /powershell/
3-
topicHref: /powershell
1+
- name: Docs
2+
tocHref: /
3+
topicHref: /
44
items:
5-
- name: Desired State Configuration
6-
tocHref: /powershell/dsc/
7-
topicHref: /powershell/dsc/index
5+
- name: PowerShell
6+
tocHref: /powershell/
7+
topicHref: /powershell
8+
items:
9+
- name: Desired State Configuration
10+
tocHref: /powershell/dsc/
11+
topicHref: /powershell/dsc/index

dsc/docfx.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"build": {
3-
"content": [
4-
{ "files": ["**/**.md", "**/**.yml"], "exclude": ["**/obj/**"] }
5-
],
3+
"content": [{
4+
"files": ["**/**.md", "**/**.yml"],
5+
"exclude": ["**/obj/**"]
6+
}],
67
"globalMetadata": {
78
"toc_preview": true,
89
"breadcrumb_path": "~/bread/toc.yml",
@@ -23,9 +24,10 @@
2324
"ms.author": { "**/**.md": "robreed" },
2425
"author": { "**/**.md": "bobbytreed" }
2526
},
26-
"resource": [
27-
{ "files": ["**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg"], "exclude": ["**/obj/**", "**/includes/**"] }
28-
],
27+
"resource": [{
28+
"files": ["**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg"],
29+
"exclude": ["**/obj/**", "**/includes/**"]
30+
}],
2931
"template": "op.html",
3032
"dest": "dsc",
3133
"markdownEngineName": "markdig"

gallery/bread/toc.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
- name: PowerShell
2-
tocHref: /powershell/
3-
topicHref: /powershell
1+
- name: Docs
2+
tocHref: /
3+
topicHref: /
44
items:
5-
- name: Gallery
6-
tocHref: /powershell/gallery/
7-
topicHref: /powershell/gallery/index
8-
5+
- name: PowerShell
6+
tocHref: /powershell/
7+
topicHref: /powershell
8+
items:
9+
- name: Gallery
10+
tocHref: /powershell/gallery/
11+
topicHref: /powershell/gallery/index

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

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
---
2-
ms.date: 06/09/2017
2+
ms.date: 09/09/2019
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Language_Modes
77
---
8-
98
# About Language Modes
109

1110
## SHORT DESCRIPTION
12-
1311
Explains language modes and their effect on PowerShell sessions.
1412

1513
## LONG DESCRIPTION
@@ -35,7 +33,7 @@ particular session configuration have the language mode of the session
3533
configuration.
3634

3735
All PowerShell sessions have a language mode, including PSSessions that you
38-
create by using the New-PSSession cmdlet, temporary sessions that use the
36+
create by using the `New-PSSession` cmdlet, temporary sessions that use the
3937
ComputerName parameter, and the default sessions that appear when you start
4038
PowerShell.
4139

@@ -51,47 +49,49 @@ This section describes the language modes in PowerShell sessions.
5149

5250
#### FULL LANGUAGE (FullLanguage)
5351

54-
The FullLanguage language mode permits all language elements in the session.
52+
The FullLanguage mode permits all language elements in the session.
5553
FullLanguage is the default language mode for default sessions on all versions
5654
of Windows except for Windows RT.
5755

5856
#### RESTRICTED LANGUAGE (RestrictedLanguage)
5957

60-
In RestrictedLanguage language mode, users may run commands (cmdlets,
61-
functions, CIM commands, and workflows) but are not permitted to use script
62-
blocks.
58+
In RestrictedLanguage mode, users may run commands (cmdlets, functions, CIM
59+
commands, and workflows) but are not permitted to use script blocks.
6360

6461
By default, only the following variables are permitted in RestrictedLanguage
65-
language mode:
62+
mode:
6663

67-
- \$PSCulture
68-
- \$PSUICulture
69-
- \$True
70-
- \$False
71-
- \$Null.
64+
- `$PSCulture`
65+
- `$PSUICulture`
66+
- `$True`
67+
- `$False`
68+
- `$Null`
7269

7370
Only the following comparison operators are permitted:
7471

75-
- -eq (equal)
76-
- -gt (greater-than)
77-
- -lt (less-than)
72+
- `-eq` (equal)
73+
- `-gt` (greater-than)
74+
- `-lt` (less-than)
7875

7976
Assignment statements, property references, and method calls are not
8077
permitted.
8178

8279
#### NO LANGUAGE (NoLanguage)
8380

84-
In NoLanguage language mode, users may run commands, but they cannot use any
85-
language elements.
81+
NoLanguage mode can only be used through the API. NoLanguage mode means no
82+
script text of any form is permitted. This precludes the use of the
83+
**AddScript()** method which sends fragments of PowerShell script to be parsed
84+
and executed. You can only use **AddCommand()** and **AddParameter()** which
85+
don't go through the parser.
8686

8787
#### CONSTRAINED LANGUAGE (Constrained Language)
8888

89-
The ConstrainedLanguage language mode permits all Windows cmdlets and all
90-
PowerShell language elements, but it limits permitted types.
89+
The ConstrainedLanguage mode permits all cmdlets and all PowerShell language
90+
elements, but it limits permitted types.
9191

92-
ConstrainedLanguage language mode is designed to support User Mode Code
93-
Integrity (UMCI) on Windows RT. It is the only supported language mode on
94-
Windows RT, but it is available on all supported systems.
92+
ConstrainedLanguage mode is designed to support User Mode Code Integrity (UMCI)
93+
on Windows RT. It is the only supported language mode on Windows RT, but it is
94+
available on all supported systems.
9595

9696
UMCI protects ARM devices by allowing only Microsoft-signed and
9797
Microsoft-certified apps to be installed on Windows RT-based devices.
@@ -110,37 +110,35 @@ The features of ConstrainedLanguage mode are as follows:
110110
modules export run in the session.
111111

112112
- In PowerShell Workflow, you can write and run script workflows (workflows
113-
written in the PowerShell language). XAML-based workflows are not
114-
supported and you cannot run XAML in a script workflow, such as by using
115-
"Invoke-Expression -Language XAML". Also, workflows cannot call other
113+
written in the PowerShell language). XAML-based workflows are not supported
114+
and you cannot run XAML in a script workflow, such as by using
115+
`Invoke-Expression -Language XAML`. Also, workflows cannot call other
116116
workflows, although nested workflows are permitted.
117117

118-
- The Add-Type cmdlet can load signed assemblies, but it cannot load
118+
- The `Add-Type` cmdlet can load signed assemblies, but it cannot load
119119
arbitrary C# code or Win32 APIs.
120120

121-
- The New-Object cmdlet can be used only on allowed types (listed below).
121+
- The `New-Object` cmdlet can be used only on allowed types (listed below).
122122

123-
- Only allowed types (listed below) can be used in PowerShell. Other types
124-
are not permitted.
123+
- Only allowed types (listed below) can be used in PowerShell. Other types are
124+
not permitted.
125125

126-
- Type conversion is permitted, but only when the result is an allowed
127-
type.
126+
- Type conversion is permitted, but only when the result is an allowed type.
128127

129128
- Cmdlet parameters that convert string input to types work only when the
130129
resulting type is an allowed type.
131130

132-
- The ToString() method and the .NET methods of allowed types (listed
131+
- The **ToString()** method and the .NET methods of allowed types (listed
133132
below) can be invoked. Other methods cannot be invoked.
134133

135-
- Users can get all properties of allowed types. Users can set the values
136-
of properties only on Core types.
134+
- Users can get all properties of allowed types. Users can set the values of
135+
properties only on Core types. Only the following COM objects are permitted:
137136

138-
- Only the following COM objects are permitted.
139-
- Scripting.Dictionary
140-
- Scripting.FileSystemObject
141-
- VBScript.RegExp
137+
- **Scripting.Dictionary**
138+
- **Scripting.FileSystemObject**
139+
- **VBScript.RegExp**
142140

143-
The following types are permitted in ConstrainedLanguage language mode. Users
141+
The following types are permitted in ConstrainedLanguage mode. Users
144142
can get properties, invoke methods, and convert objects to these types.
145143

146144
Allowed Types:
@@ -200,7 +198,7 @@ the session configuration has a LanguageMode property. You can find the
200198
language mode by getting the value of the LanguageMode property.
201199

202200
```powershell
203-
PS C:\> (Get-PSSessionConfiguration -Name Test).LanguageMode
201+
PS> (Get-PSSessionConfiguration -Name Test).LanguageMode
204202
FullLanguage
205203
```
206204

@@ -217,15 +215,15 @@ state.
217215
For example:
218216

219217
```powershell
220-
PS C:> $ExecutionContext.SessionState.LanguageMode
218+
PS> $ExecutionContext.SessionState.LanguageMode
221219
ConstrainedLanguage
222220
```
223221

224-
However, in sessions with RestrictedLanguage and NoLanguage language modes,
222+
However, in sessions with RestrictedLanguage and NoLanguage modes,
225223
you cannot use the dot method to get property values. Instead, the error
226224
message reveals the language mode.
227225

228-
When you run the \$ExecutionContext.SessionState.LanguageMode command in a
226+
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
229227
RestrictedLanguage session, PowerShell returns the
230228
PropertyReferenceNotSupportedInDataSection and
231229
VariableReferenceNotSupportedInDataSection error messages.
@@ -236,11 +234,11 @@ VariableReferenceNotSupportedInDataSection error messages.
236234
referenced in restricted language mode or a Data section is being
237235
referenced.
238236

239-
When you run the \$ExecutionContext.SessionState.LanguageMode command in a
237+
When you run the `$ExecutionContext.SessionState.LanguageMode` command in a
240238
NoLanguage session, PowerShell returns the ScriptsNotAllowed error message.
241239

242-
- ScriptsNotAllowed: The syntax is not supported by this runspace. This
243-
might be because it is in no-language mode.
240+
- ScriptsNotAllowed: The syntax is not supported by this runspace. This might
241+
be because it is in no-language mode.
244242

245243
## KEYWORDS
246244

@@ -253,4 +251,3 @@ NoLanguage session, PowerShell returns the ScriptsNotAllowed error message.
253251

254252
- [about_Session_Configuration_Files](about_Session_Configuration_Files.md)
255253
- [about_Session_Configurations](about_Session_Configurations.md)
256-
- [about_Windows_RT](about_Windows_RT.md)

0 commit comments

Comments
 (0)