How to Encrypt Passwords in PowerShell

Security is definitely an issue with Powershell as anyone can see your code. However, there are ways to hide passwords used by your Powershell whilst not affecting its objective.