# Export secedit:
secedit /export /cfg C:\secpol.cfg
# Change secedit:
(Get-Content C:\secpol.cfg) `
-replace '^PasswordComplexity\s*=\s*\d+', 'PasswordComplexity = 0' |
Set-Content C:\secpol.cfg
# Import secedit back:
secedit /configure `
/db C:\Windows\Security\Database\local.sdb `
/cfg C:\secpol.cfg `
/areas SECURITYPOLICY
# Update Group Policy settings:
gpupdate /force