Ready to get started?

Learn more about the OFX PowerShell Cmdlets or download a free trial:

Download Now

Pipe OFX Data to CSV in PowerShell

Use standard PowerShell cmdlets to access OFX tables.

The CData Cmdlets Module for OFX is a standard PowerShell module offering straightforward integration with OFX. Below, you will find examples of using our OFX Cmdlets with native PowerShell cmdlets.

Creating a Connection to Your OFX Data

The OFXUser and OFXPassword properties, under the Authentication section, must be set to valid OFX user credentials. In addition to this, you will need to configure FIURL, FIOrganizationName, and FIID, which will be specific for the financial institution. You will also need to provide application-specific settings, including OFXVersion, ApplicationVersion, and ApplicationId.

To connect to some services, you will need to provide additional account information such as AccountId, AccountType, BankId, BrokerId, and CCNumber.

$conn = Connect-OFX  -OFXUser "$OFXUser" -OFXPassword "$OFXPassword" -FIID "$FIID"

Selecting Data

Follow the steps below to retrieve data from the InvBalances table and pipe the result into to a CSV file:

Select-OFX -Connection $conn -Table InvBalances | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myInvBalancesData.csv -NoTypeInformation

You will notice that we piped the results from Select-OFX 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.