Q. What's a good way to create a secure, random password in PowerShell?
A. Previously, I explained how to create a password using random characters generated by the System.Random object, but this may not be secure enough.
So try this method: Use the GeneratePassword method of System.Web.Security.Membership, which enables a number of characters for the new password to be specified and the number of special characters that are required within the new password. Here's where this is documented.
To use this in PowerShell use:
Add-Type -AssemblyName System.Web
You can save the output to a variable then use as needed.