-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add description of PowerShell Core configuration settings #5947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
docs/learning-powershell/PowerShellConfigurationSettings.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # `PowerShell Core` configuration settings | ||
|
|
||
| `PowerShell Core` is configured using the following schemes: | ||
|
|
||
| - On Windows - Group Policy Objects (GPO), Group Policy Preferences (GPP) and configuration files | ||
| - On Unix - configuration files. | ||
|
|
||
| **Caution!** The configuration schemes differ from `PowerShell Core` _profile_ files. | ||
|
|
||
| Configuration schemes allow to customize `PowerShell Core` in the most flexible way: | ||
|
|
||
| - Enterprise administrators can use GPO, GPP and computer-wide confuguration files to apply approved configuration settings and mandatory security settings in a centralized manner. The same settings can be applied at user or application levels. | ||
| - Developers and consumers can use user and application level files. | ||
|
|
||
| `PowerShell Core` settings are grouped into policies and options. Options are normal configuration settings. Policies is high priority and overlap options. | ||
|
|
||
| ## Priority of applying settings | ||
|
|
||
| Because a configuration setting can be in several schemes, the setting wins according to the priority of its scheme. | ||
|
|
||
| ### Priorities for Policies in descending order | ||
|
|
||
| Scheme | Windows | Unix | ||
| -| - | - | ||
| GPO -> Computer Policy | HKLM\Software\Policies\Microsoft\Windows\PowerShellCore | /etc/powershell.config.json | ||
| GPO -> User Policy | HKCU\Software\Policies\Microsoft\Windows\PowerShellCore | | ||
| File -> Computer-Wide | %ProgramFiles%/PowerShell/powershell.config.json | /opt/Microsoft/powershell/powershell.config.json | ||
| File -> User-Wide | %APPDATA%/powershell.config.json | ~/powershell.config.json | ||
| File -> Application-Wide | $home/powershell.config.json | $home/powershell.config.json | ||
|
|
||
| ### Priorities for Options in descending order | ||
|
|
||
| Scheme | Windows | Unix | ||
| -| - | - | ||
| File -> Application-Wide | $home\powershell.config.json | $home/powershell.config.json | ||
| File -> User-Wide | %APPDATA%\powershell.config.json | ~/powershell.config.json | ||
| File -> Computer-Wide | %ProgramFiles%\PowerShell\powershell.config.json | /opt/Microsoft/powershell/powershell.config.json | ||
| GPO -> User Config | HKCU\Software\Microsoft\Windows\PowerShellCore | | ||
| GPO -> Computer Config | HKLM\Software\Microsoft\Windows\PowerShellCore | /etc/powershell.config.json | ||
|
|
||
| ## Configuration settings | ||
|
|
||
| A set of configuration settings in GPO scheme and file scheme for policies and options is the same. This allows to discover and configure settings in the simplest and fastest way. | ||
|
|
||
| ## Registry keys and settings | ||
|
|
||
| | Key | SubKey | Option | Type | ||
| | -| - | - | - | ||
| Software\Policies\Microsoft\Windows\PowerShellCore | - | - | ||
| Software\Microsoft\PowerShellCore | - | - | ||
| | | | ExecutionPolicy | String | ||
| | | | PipelineMaxStackSizeMB | DWORD | ||
| | | ConsoleSessionConfiguration | EnableConsoleSessionConfiguration | DWORD | ||
| | | ConsoleSessionConfiguration | ConsoleSessionConfigurationName | String | ||
| | | ModuleLogging | EnableModuleLogging | DWORD | ||
| | | ModuleLogging | ModuleNames | String | ||
| | | ProtectedEventLogging | EncryptionCertificate | DWORD | ||
| | | ScriptBlockLogging | EnableScriptBlockInvocationLogging | DWORD | ||
| | | ScriptBlockLogging | EnableScriptBlockLogging | DWORD | ||
| | | Transcription | EnableTranscripting | DWORD | ||
| | | Transcription | EnableInvocationHeader | DWORD | ||
| | | Transcription | OutputDirectory | String | ||
| | | UpdatableHelp | DefaultSourcePath | String | ||
| |Software\Policies\Microsoft\Windows\EventLog | ProtectedEventLogging | EnableProtectedEventLogging | DWORD | ||
|
|
||
| ## Json file settings | ||
|
|
||
| ```json | ||
| { | ||
| "PowerShellOptions": { | ||
| // or "PowerShellPolicies": { | ||
| "ConsoleSessionConfiguration": { | ||
| "EnableConsoleSessionConfiguration": true, | ||
| "ConsoleSessionConfigurationName": "name" | ||
| }, | ||
| "ProtectedEventLogging": { | ||
| "EnableProtectedEventLogging": false, | ||
| "EncryptionCertificate": [ | ||
| "Joe" | ||
| ] | ||
| }, | ||
| "ScriptBlockLogging": { | ||
| "EnableScriptBlockInvocationLogging": true, | ||
| "EnableScriptBlockLogging": false | ||
| }, | ||
| "ScriptExecution": { | ||
| "ExecutionPolicy": "RemoteSigned", | ||
| "PipelineMaxStackSizeMB": 10 | ||
| }, | ||
| "Transcription": { | ||
| "EnableTranscripting": true, | ||
| "EnableInvocationHeader": true, | ||
| "OutputDirectory": "c:\\tmp" | ||
| }, | ||
| "UpdatableHelp": { | ||
| "DefaultSourcePath": "f:\\temp" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell Core GPO registry keys are at
Software\Policies\Microsoft\PowerShellCore.