Question

I've long used a cmd.exe script to set up new (virtual) machines. I'm tired of using reg.exe and regedit.exe to set registry values - both are quirky. I suspect powershell is a better solution for my problem. Could someone share their powershell script that sets registry keys the way they want them?

Was it helpful?

Solution

Here's a very simple one:

[UInt16]$limit = Read-Host -Prompt "Enter max number of CodeAnalysis " + `
                                   "warnings to display (default is 200)"
if ($limit -eq 0) { $limit = 200 }

$path = 'HKLM:\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev'
Set-ItemProperty -Path $path -Name CodeAnalysisErrorListViolationLimit `
                             -Value $limit
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top