A great question came in yesterday about how to use the new –Credential parameter that was implemented in v2.5 Toolkit.

Question: What if someone wants to use the script the old way, and programmatically send the password?

Approach #1

Create a new credential variable and require a prompt for credentials entry via the traditional dialog box.

Now $Creds can be viewed with $Creds.Username and $Creds.Password. The Password is in the form of a System.Security.SecureString.

Then when creating a connection to the FlashArray you can pass the $Creds into the cmdlet.

Approach #2

Create a new PSCredential object that can then be passed to the Get-PfaApiToken programmatically.


Have a $Credentials day!