2014-11-03 26 views
2

我试图用巧克力味的NuGet来安装PostgreSQL密码复杂性错误,我得到以下错误:如何使用的巧克力的NuGet安装的Postgres,当我收到

Write-Error : postgresql did not finish successfully. Boo to the chocolatey gods!

[ERROR] Exception calling "SetInfo" with "0" argument(s): "The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.

这是因为被设置的用户名是Postgres的密码是Postgres1234,所以我想you aren't allowed your username in your password

有没有办法将密码作为参数传递给巧克力装置? 或者一些Powershell的魔法我可以用来改变密码规则,而我运行包?


更新:我pull request在PG 8,9套餐更改密码已被接受所以这个问题应该消失,一旦包的新版本通过choco install

回答

1

所以是可见的,我已经设法禁止使用密码复杂性要求:

#Postgres cannot install because the password contains the username so 
Mkdir c:\temp -ErrorAction SilentlyContinue 
secedit /export /cfg c:\temp\secpol.cfg 
(gc c:\temp\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | sc C:\temp\secpol.cfg 
secedit /configure /db c:\windows\security\local.sdb /cfg c:\temp\secpol.cfg /areas SECURITYPOLICY 
rm -force c:\temp\secpol.cfg -confirm:$false 
#then install 
cinst postgresql 
cinst pgadmin3 

的SECEDIT电话是答案found here的修改版本。这个答案并不能保存在这里添加的secpol文件的更改| sc C:\temp\secpol.cfg

显然,如果你来到这里并粘贴这段代码......你应该考虑事后复杂化。

我仍然对解决这个问题的更好方法感兴趣...

+0

所以这是很容易修复的。该软件包在https://github.com/ferventcoder/chocolatey-packages中已经结束,不过您可以编辑chocolateyInstall.ps1来更改密码,然后执行-force安装以获得更安全的密码。请注意,由于重写将删除软件包并重新安装相同版本,因此此功能将消失。 – ferventcoder 2014-11-03 19:51:01

+1

是的,https://github.com/ferventcoder/chocolatey-packages/pull/33 :) – 2014-11-04 09:01:20

相关问题