Created
November 7, 2019 16:47
-
-
Save RichieBzzzt/e7c1ba2f3ae5a1fc8de001970c01ff33 to your computer and use it in GitHub Desktop.
This file contains 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
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.