Passing passwords via Powershell steps


Description

If you have a requirement to pass passwords through a Powershell step but do not want to pass them as plain text, you may follow the steps in this article to re-encrypt and format it for transmission to the MID server. 

Instructions

Before the Powershell step, create a Script step with the following script and pass the output to the Powershell step:

(function execute(inputs, outputs) {
var encrypter = new GlideEncrypter();
var reEncrypted = encrypter.reencryptParamForAutomation(inputs.password);
outputs.encrypted_for_mid = reEncrypted;
})(inputs, outputs);

This will re-encrypt the password and format it for transmission to the MID server.