It is both cool and a little scary how ChatGPT can not only write poems but also write code.
My ask: “Write a Pure Storage PowerShell SDK connect script“
It is missing some parameters but is ~80% of the way there.
Here is an example of a PowerShell script that connects to a Pure Storage FlashArray using the Pure Storage PowerShell SDK:
# Import the Pure Storage PowerShell SDK Import-Module PureStoragePowerShellSDK # Connect to the FlashArray $flashArray = Connect-PfaArray -EndPoint "flasharray.example.com" -APIKey "YOUR_API_KEY" # Check the connection $flashArray | Get-PfaArray
You will need to replace “flasharray.example.com” with the IP address or hostname of your FlashArray, and “YOUR_API_KEY” with a valid API key for your FlashArray.
You can also specify additional parameters such as -IgnoreCertificate, -ConnectTimeout and -ReadTimeout for the Connect-PfaArray command.
After running the script, you should see information about the FlashArray, such as its model and version, if the connection was successful.
You can then use the $flashArray variable to run other commands and interact with the FlashArray using the SDK.
Please note that this script is for demonstration only, you should review and modify the script to fit your specific use case, and also ensure that you have the Pure Storage PowerShell SDK installed in your system before running the script.
I’ve seen some PowerShell modules/scripts on GitHub that calls ChatGPT but haven’t played with those yet. I think I’ll just start using in Visual Studio Code with VS ChatGPT.
Cheers — Barkz