In this blog post I will show you my project for generating passwords with PowerShell. The goal is to develop a password generator which outputs an account name and the corresponding password and stores it in the clipboard.
When I execute this command, a password is generated and output along with the account name. It is also saved to the clipboard.
Generate-Password -Account email@example.com -Length 14
This leads to the following output.
Interested to get this function?
Then copy the lines below to PowerShell ISE or VS Code and run it. The module is then saved to the Modules folder and you can immediately start generating passwords with PowerShell.
Start-BitsTransfer ` -Source https://patrick6649.files.wordpress.com/2021/10/generate-password.zip ` -Destination $home\documents\generate-password.zip New-Item ` -ItemType Directory ` -Path $env:PSModulePath.Split(';') ` -Name Generate-Password Expand-Archive ` -Path $home\documents\generate-password.zip ` -DestinationPath "$($env:PSModulePath.Split(';') + '\Generate-Password')"
Now type Generate-Password and provide an account name as well as the desired length of your password.