Skip to content

Instantly share code, notes, and snippets.

@moorer2k
Created May 28, 2021 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moorer2k/4fd89875f1b5f4c93995319e39e82c83 to your computer and use it in GitHub Desktop.
Save moorer2k/4fd89875f1b5f4c93995319e39e82c83 to your computer and use it in GitHub Desktop.
Simple PowerShell script to change between your min / max threads to use for XMRIG on windows.
#Automatically switch between desired threads for XMRIG.
$path = 'C:\Users\Moore\Desktop\xmrig\config.json'
$minThreads = '15'
$maxThreads = '28'
if (Select-String -Path $path -Pattern "$minThreads," -SimpleMatch -Quiet)
{
(Get-Content $path) -replace "$minThreads,", "$maxThreads," | Out-File -encoding ASCII $path
}
else
{
(Get-Content $path) -replace "$maxThreads," , "$minThreads," | Out-File -encoding ASCII $path
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment