This blog describes how to handle passwords when writing PowerShell automation using Credential Manager