PowerShell Core logging configuration

After having browsed through the PowerShell code a bit, found some references as to how to configure PowerShell Core logging options through GPO or via a configuration file.

There are no GPO Templates available for PowerShell Core, but the same settings as are written for Windows PowerShell also apply for Core, they just live within another registry key.


So when you apply the folllowing registry settings , you can enable ScriptBlock logging and Transcripting for PowerShell Core.

Windows Registry Editor Version 5.00




So until we get proper Group Policy templates, logging for PowerShell Core can be configured through Group Policy Preferences.

Reference to the source code section: “#region GroupPolicy Configs


Another option to configure these settings , if you do are not enforcing stuff for your users, but don’t want to fiddle with registry settings, is to use the confguration file.

“C:\Program Files\PowerShell\6.0.0\powershell.config.json”

that by default has the following content:

Replacing it with the below configuration example will also enable PowerShell core logging options.
“Microsoft.PowerShell:ExecutionPolicy”: “RemoteSigned”,
  “PowerShellPolicies”: {
    “ScriptExecution”: {
      “ExecutionPolicy”: “RemoteSigned”,
      “EnableScripts”: true
    “ScriptBlockLogging”: {
      “EnableScriptBlockInvocationLogging”: true,
      “EnableScriptBlockLogging”: true
    “ModuleLogging”: {
      “EnableModuleLogging”: true,
      “ModuleNames”: [
    “ProtectedEventLogging”: {
      “EnableProtectedEventLogging”: false,
      “EncryptionCertificate”: [
    “Transcription”: {
      “EnableTranscripting”: true,
      “EnableInvocationHeader”: true,
      “OutputDirectory”: “C:\\dev\\pscore6log”
    “UpdatableHelp”: {
      “DefaultSourcePath”: “C:\\dev\\pscorehelp”
    “ConsoleSessionConfiguration”: {
      “EnableConsoleSessionConfiguration”: false,
      “ConsoleSessionConfigurationName”: “name”
  “LogLevel”: “verbose”


Leave a Reply