Skip to content

Instantly share code, notes, and snippets.

@Sh1n0g1
Last active March 19, 2021 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Sh1n0g1/b7d3633aafa3bc2fca7785c0f88ea7e8 to your computer and use it in GitHub Desktop.
Save Sh1n0g1/b7d3633aafa3bc2fca7785c0f88ea7e8 to your computer and use it in GitHub Desktop.
@echo off
net session >nul 2>&1
if %errorlevel% == 0 (
echo|set /p="Adding registry 1:"
reg add HKLM\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ /v EnableModuleLogging /f /t REG_DWORD /d 1
echo|set /p="Adding registry 2:"
reg add HKLM\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames /f /v ^* /t REG_SZ /d ^*
echo Powershell logging successfully enabled.
) else (
echo Error: You need adminstrator right.
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment