Pure Storage FlashArray PowerShell SDK v1.19 released

It has been well over a year since our last major release of the PowerShell SDK version 1 when we introduced version 1.17.3 in April of 2020. We have had two incremental releases since then, but a new major version has been in the works for a few months now. After some great work by our Connect Development Team, I am happy to announce that we have released the last major version of the SDK version 1! Version 1.19.37 is now available via Install-Module from the PowerShell Gallery, as well as in our GitHub repository as an MSI installer for those that still require a standalone install.

A bit of history…

For those paying close attention, you may have noticed that I said “…the last major version of SDK v1” in that announcement. Yes, it is true that version 1.19 will be the last in a very long line of version 1 releases. As a bit of Pure history trivia, SDK version 1 was created back in 2015 when a really smart guy named Barkz (@8arkz and purepowershellguy.com) came up with the idea to create the first PowerShell SDK for the FlashArray. Fast forward to today and the FlashArray API has been at version 2 for over two years now since the release of Purity 5.3.0, while also being backwards compatible with the 1.17 API. Since then, the FlashArray API team has extended the API for Purity releases prior to 5.3.x to API version 1.19, adding more endpoints and capabilities. Now the transition to the new 2.x API is complete and there will no longer be any updates to the 1.19 API. This also means that there will no longer be any major updates to the PowerShell SDK version 1. Of course there will be updates to the SDK v2, but more on that later.

Pure Storage FlashArray PowerShell SDK release history
Pure Storage FlashArray PowerShell SDK release history


So, what’s new?

In this release, we have added 25 new cmdlets, bringing the total number to 466. The new cmdlets are focused around features introduced in the FlashArray REST API 1.19 including volume and snapshot tags, Pod replication and promotion, replication metrics, offload status,  and API tokens. We also added a much sought after wrapper cmdlet – Invoke-PfaRestCommand which allows for issuing commands directly to the API. We also included some enhancements for persistent array connections (just like in SDKv2) and expanded the cmdlet online Help. Of course, we included a few fixes in there from previous versions and just a couple of known issues. These are all outlined in the release notes which you can find here. I’ll update this post with a link to an introductory video I created showing some of the highlights.

One other feature we added was a PowerShell version check and allow me to explain this a bit. The SDK v1 was created on the .Net Framework platform. PowerShell versions 6.0 and later are based on the .Net Core platform. So that means that code like the SDK v1 can only be run in PowerShell version 5.1, the last .Net Framework compatible release. So, what we did was to check to make sure that you are running the module in a supported version of PowerShell when connecting to an array using the New-PfaArray cmdlet. We would have really liked to have done that check when you load the module with the Import-Module cmdlet, but without getting into the fuzzy details of why, just know that we tried (really we did), but it is just not possible within the PowerShell framework, partially due to it’s module “auto-loading” feature. The bottom line is that the SDKv1 can only be run in a PowerShell session that is version 3.0 to 5.1.x, and not in any later versions. As an alternative, you can run both the SDKv1 and the SDKv2 together in a 5.1 session since SDKv2 can be run in any version of PowerShell. This actually brings the best features of both SDKs together for you to satisfy your automation needs! I created a short video of that process when we released SDKv2 last year.

Go get the bits!

I encourage you to go ahead and download the latest release and test it with your current automations. The key word there is TESTalways test new releases first, especially scripts that use commands that are destructive in nature, and preferably not in production to make sure all your current scripts continue to work without any issues. Just as with any new release, we may have a few quirks that need a bit of adjusting or maybe we have a work-around. But, as the saying goes, we don’t know what we don’t know. Please give us your feedback! It really is critical for us to hear all of the good and not-so-good things about your use of the SDKs. Also, be sure to check out the SDKv1-Examples.ps1 file in the GitHub repository as well for some useful snippets of code that you can use to familiarize yourself with the cmdlets and use in your scripts. If you care to chat with fellow code enthusiasts and Puritans, or run into a problem, be sure to hit us up on our Code Slack workspace or file an Issue in our GitHub repository. I also encourage the use of our API documentation to better understand how the SDK is interacting with the API. It is readily available under the Help option on any FlashArray, or you can also download a Docker Container image with all of the API specifications.

One more thing…

I almost forgot (not really, after all, it’s a blog post!). What about that little tidbit of information I mentioned in the beginning of this post about an upcoming next release of the SDK version 2? Well, I can tell you that it is being worked on now, it is going to have a boatload of new features and capabilities, and it will be EPIC! Stay tuned to the Code Slack and this blog in 2022 for more details!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.