Here is a very simple way to create complex random passwords:
Add-Type -AssemblyName System.Web $PasswordLength = 12 $SpecialCharCount = 3 [System.Web.Security.Membership]::GeneratePassword($PasswordLength, $SpecialCharCount)
The API call lets you choose the length of the password, and the number of non-alphanumeric characters it contains.