While writing powershell scripts you may have needed to store the username and password inside the script. There are couple of ways to do so. Either you export the password to a text or xml file and then call it inside the script every time the script runs or generate the password combination using another script and save it inside the main script.
Second way of doing it is much easier but requires another powershell script to be run for generation of credentials.
While working on some script I needed to store the credentials inside the same powershell script. Although there was no need of doing so; someone wanted it that way.
This script generates the code that can be directly pasted inside the main script where you want to save your credentials.
Just enter the username (in the format you want) and enter the password associated with that username and click on generate button. That is all! The code you needed is ready in the text box below:
This really simple script can be handy in your toolbox if you are a powershell developer or you do some scripting stuff for fun.