Forum Discussion
- cmautnerPuritanHey Scott can you send me the full snippet of code you are using? Feel free to DM if you don’t want to post it here
- cmautnerPuritanSo I modified the code a bit but see below: ```$ArrayList = @("gse-array05","gse-array06") $myCredential = Get-Credential # Loop through each entry in the CSV foreach ($Entry in $ArrayList) { $Array = $Entry $objArray = Connect-Pfa2Array -Endpoint $Array -Credential $myCredential -IgnoreCertificateError #operate with array using $objArray on subsequent calls Disconnect-Pfa2Array -Array $objArray }```
- cmautnerPuritanYou can loop like you are wanting, take the array out of quotes… then operate on the object that is returned from the connect
- cmautnerPuritanAnd be sure to disconnect, its important in SDKv2, when looping like this
- mike082Novice INice work sir. Thanks!
- cmautnerPuritanThere was more to it Mike, I just modified what he had down to bare bones
- cmautnerPuritansstockton Here are some more examples using the SDK2… these revolve around refreshing SQL environments, but there various examples of using the SDK2 in different ways: https://github.com/PureStorage-OpenConnect/sqlserver-scripts/tree/master/demos-sdk2
- mike082Novice Icmautner And that sir is why you are a Rockstar!