Last active
February 19, 2025 15:25
-
-
Save jymcheong/f06fc33d009fba056050ffc70cdf96f1 to your computer and use it in GitHub Desktop.
Auto-install Nxlog with Chocolatey Package Manager
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
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
iex "choco install nxlog -y" | |
$client = New-Object System.Net.WebClient | |
# download & save the correct nxlog config which includes Sysmon, Nxlog WILL FAIL if Sysmon is not installed | |
if ([System.IntPtr]::Size -eq 4) { # I also assumed no change in default install paths | |
$url = "https://raw.githubusercontent.com/jymcheong/SysmonResources/master/6.%20Sample%20Data/nxlog.conf32.txt" | |
$path = "C:\Program Files\nxlog\conf\nxlog.conf" | |
} else { | |
$url = "https://raw.githubusercontent.com/jymcheong/SysmonResources/master/6.%20Sample%20Data/nxlog.conf64.txt" | |
$path = "C:\Program Files (x86)\nxlog\conf\nxlog.conf" | |
} | |
$client.DownloadFile($url, $path) | |
# restart nxlog service | |
Restart-Service -Name nxlog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need admin rights. Tested on Win7ent 32bit & win10-64bit.