How to Enable PowerShell Logging (Script Block and Module)
To enable PowerShell logging, turn on Script Block Logging, which records the code of every script and command that runs. For Windows PowerShell 5.1, set this registry value as administrator: PowerShell 7 uses its own key and log. Below I check what’s already on, explain the three kinds of logging and show how to enable … Read more