The Pure Storage PowerShell SDK supports our REST API from 1.0 — 1.13 today. If you want to know what the highest version that is supported by a FlashArray use the below URL and see the results of “version”. The SDK supports backward compatibility for previous versions of the REST API.

To view the REST API versions available on your FlashArray use the below URL.

Below is how to use the New-PfaArray cmdlet to connect to a FlashArray. In the example you’ll see the use of -Version 1.13. As a best practice using this parameter helps to ensure backward compatibility with your existing scripts. This is important with the SDK because as we introduce new REST API updates the SDK may not be on parity with the new REST version. As you are developing your scripts using this parameter will ensure they work. If this parameter is not specified it will default to using the highest version of REST that is available and could cause issues.

To explain why this is important let’s look at the New-PfaCertificateSigningRequest cmdlet. In REST 1.11 we did not support named certificates and any operations worked without using a name. Using REST the GET/cert method retrieves attributes of a single certificate. In REST 1.12+ we support named certificates. Using the previous REST call in 1.12 (GET/cert) would fail. You would need to use GET/cert/<certname> to retrieve specific attributes for that certificate. In the current SDK 1.13 we do not support named certificates only single certificates.

Without using the -Version parameter when establishing the FlashArray connection a script would fail as it defaults to the highest version of the REST API. But if you specify as you develop scripts this would work because it is targeting that specific REST API.

So to ensure the New-PfaCertificateSigningRequest cmdlet works the New-PfaArray cmdlet would be as follows:

I hope this helps explain why it is a best practice to use -Version parameter and how it can help safe guard your scripts.

Thanks //barkz