
If ($AllowedLowercase.Count -lt 1 -and $MinLowercaseChars -gt 0) Throw "The specified length is less than the sum of the minimum character counts." # For all if statements below, throw erorr if minimum requirements not met. $FillerCharCount = $Length - ($MinLowercaseChars + $MinUppercaseChars + $MinDigits + $MinSpecialChars) # FillerCharCount refers to the amount of characters not dictated by the required minimum of each type "abcdefghijklmnopqrstuvwxyz".ToCharArray().ForEach()) Param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
I've commented it, because he did not do that.
I use a colleuge of mines new-password script.
Some are even harder, like "has to be 16 or more, can't contain a dictionary word, can't have three letters/numbers in a row, must have a minimum of 6 different special characters, but not the same characters, and it can't be 'similar' to previous passwords." When it rejects your password, you aren't even told why. Most are standard "we need it to be 16 digits or more, mixture of letters, numbers, cases and special characters," but some won't allow certain characters, like commas, astericies, pound sign, or exclamation points. Some can only do 8 digits and numbers. We use Keepass, but the password generation is too different for a decent generator. The week I have to change my passwords is brutal. So each client requires me to change 3-8 passwords every 60 days. Each site has a VPN pass, an AD pass, and some various other passwords depending on the client (like UNIX, routers, or other appliances) and some of those clients have multiple sites (like a failover or redundant site). I work in a place now with 30-40 clients, each has their own set of passwords, and they all expire in 60 days.