Forum Discussion

Scott_Stockton's avatar
2 years ago

Connect-Pfa2Array : Cannot bind argument to parameter

Connect-Pfa2Array : Cannot bind argument to parameter 'Endpoint' because it is an empty string. At line:16 char:45 + $objArray = Connect-Pfa2Array -Endpoint "$Array"
  • Hey 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
  • So 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 }```
  • You can loop like you are wanting, take the array out of quotes… then operate on the object that is returned from the connect
  • And be sure to disconnect, its important in SDKv2, when looping like this
  • There was more to it Mike, I just modified what he had down to bare bones
  • sstockton 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