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
OK cheers!