Skip to content

Instantly share code, notes, and snippets.

@RichieBzzzt
Created November 7, 2019 16:47
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 RichieBzzzt/e7c1ba2f3ae5a1fc8de001970c01ff33 to your computer and use it in GitHub Desktop.
Save RichieBzzzt/e7c1ba2f3ae5a1fc8de001970c01ff33 to your computer and use it in GitHub Desktop.
param(
[string]
$numberOfConcurrentActivities
)
$registryPath = "HKLM:\SOFTWARE\Microsoft\DataTransfer\DataManagementGateway\Gateway"
$Name = "WorkerProcessCount"
if (($numberOfConcurrentActivities -match "^[\d\.]+$") -eq $false)
{
Write-Error "Number of concurrent activites needss to be a number."
Throw
}
if (!(Test-Path $registryPath))
{
Write-Host "Adding Registry Path..."
New-Item -Path $registryPath -Force
New-ItemProperty -Path $registryPath -Name $name -Value $numberOfConcurrentActivities -PropertyType DWORD -Force
}
else {
Write-Host "Setting WorkerProcessCount"
New-ItemProperty -Path $registryPath -Name $name -Value $numberOfConcurrentActivities -PropertyType DWORD -Force
}
@christianb7
Copy link

Firstly, Thank you for this code! We were told about this reg value by Microsoft (and also found using ProcessMonitor). The value is number of threads per core rather than total. Wrting this just in case someone else comes across the code. Hope that is OK.

@RichieBzzzt
Copy link
Author

OK cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment