When creating user accounts in PowerShell, the InvalidPasswordException error appears.
New-LocalUser: An exception of type “Microsoft.PowerShell.Commands.InvalidPasswordException”.

Cause
The Local Group Policy for password complexity requirements do not match the input, or the minimum password length is not met.
Solution

In Local Group Policy (gpedit.msc), change the Minimum Password Length, 0 for no Minimum Password Length.
Tip
The following PowerShell command creates a user account with a password from the same command line, useful for script processing.
New-LocalUser user1 -Password (ConvertTo-SecureString "8170af" -AsPlainText -Force) -FullName user1 -Description user1 -PasswordNeverExpires -UserMayNotChangePassword