Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →How to pipe Authorize.Net Data to CSV in PowerShell
Use standard PowerShell cmdlets to access Authorize.Net tables.
The CData Cmdlets Module for Authorize.Net is a standard PowerShell module offering straightforward integration with Authorize.Net. Below, you will find examples of using our AuthorizeNet Cmdlets with native PowerShell cmdlets.
Creating a Connection to Your Authorize.Net Data
You can obtain the necessary connection properties on the Security Settings -> General Settings page after logging into your Merchant Account.
- UseSandbox: The Authorize.Net API to be used to process transactions. If you are using a production account, this property can be left blank. If you are using a developer test account, set this to 'TRUE'.
- LoginID: The API login Id associated with your payment gateway account. This property is used to authenticate that you are authorized to submit website transactions. Note that this value is not the same as the login Id that you use to log in to the Merchant Interface.
- TransactionKey: The transaction key associated with your payment gateway account. This property is used to authenticate that you are authorized to submit website transactions.
$conn = Connect-AuthNet -LoginId "$LoginId" -TransactionKey "$TransactionKey"
Selecting Data
Follow the steps below to retrieve data from the SettledBatchList table and pipe the result into to a CSV file:
Select-AuthorizeNet -Connection $conn -Table SettledBatchList | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\mySettledBatchListData.csv -NoTypeInformation
You will notice that we piped the results from Select-AuthorizeNet into a Select-Object cmdlet and excluded some properties before piping them into an Export-Csv cmdlet. We do this because the CData Cmdlets append Connection, Table, and Columns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file.
The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the CData Cmdlets directly into another one.