您能否共享用于安装新计算机的powershell脚本?

您能否共享用于安装新计算机的powershell脚本?,powershell,registry,regedit,Powershell,Registry,Regedit,我一直使用cmd.exe脚本来设置新的(虚拟)机器。我厌倦了使用reg.exe和regedit.exe来设置注册表值-两者都很奇怪。我怀疑powershell是解决我问题的更好的方法。有人可以分享他们的powershell脚本,该脚本按照他们想要的方式设置注册表项吗?这里有一个非常简单的脚本: [UInt16]$limit = Read-Host -Prompt "Enter max number of CodeAnalysis " + `

我一直使用cmd.exe脚本来设置新的(虚拟)机器。我厌倦了使用reg.exe和regedit.exe来设置注册表值-两者都很奇怪。我怀疑powershell是解决我问题的更好的方法。有人可以分享他们的powershell脚本,该脚本按照他们想要的方式设置注册表项吗?

这里有一个非常简单的脚本:

[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