Forum Discussion

mike082's avatar
mike082
Novice I
2 years ago

Could we see what code your trying to execute? This

Could we see what code your trying to execute? This is one example script I use but it doesn't array the Connect-Pfa2Array. Not sure why that wouldn't work though. `# Connect to FlashArrays with OAuth2` `$FA1 = Connect-Pfa2Array -Endpoint $FA1ArrayEndpoint -Username $arrayUsername -Issuer $arrayIssuer -ApiClientName $clientName -ClientId $FA1ArrayClientId -KeyId $FA1ArrayKeyId -PrivateKeyFile $privateKeyFile -IgnoreCertificateError` `$FA2 = Connect-Pfa2Array -Endpoint $FA2ArrayEndpoint -Username $arrayUsername -Issuer $arrayIssuer -ApiClientName $clientName -ClientId $FA2ArrayClientId -KeyId $FA2ArrayKeyId -PrivateKeyFile $privateKeyFile -IgnoreCertificateError` `$LabFAs = New-Object -TypeName System.Collections.ArrayList` `$LabFAs += $FA1, $FA2` `ForEach($LabFA in $LabFAs) {` `#Snapshots` `$Snapshots = Get-Pfa2VolumeSnapshot -Array $LabFA | Where-Object { $_.Name -cmatch $snapshotPattern }` `#Volumes` `$Volumes = Get-Pfa2Volume -Array $LabFA | Where-Object { $_.Name -cmatch $volumePattern }` `#Destroy` `ForEach($Volume in $Volumes) {` `Remove-Pfa2Connection -Array $LabFA -VolumeNames $Volume.Name -HostGroupNames "Proxies"` `Remove-Pfa2Volume -Array $LabFA -IDs $Volume.Id` `}` `#Eradicate` `ForEach($Volume in $Volumes) {` `Remove-Pfa2Volume -Array $LabFA -Eradicate -Confirm:$false -IDs $Volume.Id` `}` `# Disconnect from FlashArray` `Disconnect-Pfa2Array -Array $LABFA` `}`
No RepliesBe the first to reply