Using PasswordVault with PowerShell

A handy way to securely store credentials for use by a PowerShell script (particularly one running from within a Scheduled Task) is to use the Windows PasswordVault class.  Please note that this should not be confused with the Credential Manager module.

Credentials are store and incrypted in the PasswordVault on a per-user basis.  If credentials are being stored for use by a Scheduled Task, be sure to login to the system and stash the credentials using the account that the Task will be running under. Continue reading