Automate Wave Financial Integration Tasks from PowerShell

Ready to get started?

Download for a free trial:

Download Now

Learn more:

Wave Financial ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Wave Financial.



Are you looking for a quick and easy way to access Wave Financial data from PowerShell? We show how to use the Cmdlets for Wave Financial and the CData ADO.NET Provider for Wave Financial to connect to Wave Financial data and synchronize, automate, download, and more.

The CData Cmdlets for Wave Financial are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time and bidirectional access to Wave Financial.

Cmdlets or ADO.NET?

The cmdlets are not only a PowerShell interface to the Wave Financial API, but also an SQL interface; this tutorial shows how to use both to create, retrieve, update, and delete Wave Financial data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Wave Financial. To access Wave Financial data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Wave Financial.

After obtaining the needed connection properties, accessing Wave Financial data in PowerShell consists of three basic steps.

Connect using the API Token

You can connect to Wave Financial by specifying the APIToken You can obtain an API Token using the following steps:

  1. Log in to your Wave account and navigate to "Manage Applications" in the left pane.
  2. Select the application that you would like to create a token for. You may need to create an application first.
  3. Click the "Create token" button to generate an APIToken.

Connect using OAuth

If you wish, you can connect using the embedded OAuth credentials. See the Help documentation for more information.

PowerShell

  1. Install the module:

    Install-Module WaveFinancialCmdlets
  2. Connect:

    $wavefinancial = Connect-WaveFinancial
  3. Search for and retrieve data:

    $status = "SENT" $invoices = Select-WaveFinancial -Connection $wavefinancial -Table "Invoices" -Where "Status = `'$Status`'" $invoices

    You can also use the Invoke-WaveFinancial cmdlet to execute SQL commands:

    $invoices = Invoke-WaveFinancial -Connection $wavefinancial -Query 'SELECT * FROM Invoices WHERE Status = @Status' -Params @{'@Status'='SENT'}

ADO.NET

  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Wave Financial\lib\System.Data.CData.WaveFinancial.dll")
  2. Connect to Wave Financial:

    $conn= New-Object System.Data.CData.WaveFinancial.WaveFinancialConnection("InitiateOAuth=GETANDREFRESH") $conn.Open()
  3. Instantiate the WaveFinancialDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Id, DueDate from Invoices" $da= New-Object System.Data.CData.WaveFinancial.WaveFinancialDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.id $_.duedate }

Update Wave Financial Data

PowerShell

Update-WaveFinancial -Connection $WaveFinancial -Columns @('Id','DueDate') -Values @('MyId', 'MyDueDate') -Table Invoices -Id "MyId"

ADO.NET

$cmd = New-Object System.Data.CData.WaveFinancial.WaveFinancialCommand("UPDATE Invoices SET Status='SENT' WHERE Id = @myId", $conn) $cmd.Parameters.Add(new System.Data.CData.WaveFinancial.WaveFinancialParameter("@myId","10456255-0015501366")) $cmd.ExecuteNonQuery()

Insert Wave Financial Data

PowerShell

Add-WaveFinancial -Connection $WaveFinancial -Table Invoices -Columns @("Id", "DueDate") -Values @("MyId", "MyDueDate")

ADO.NET

$cmd = New-Object System.Data.CData.WaveFinancial.WaveFinancialCommand("INSERT INTO Invoices (Status) VALUES (@myStatus)", $conn) $cmd.Parameters.Add(new System.Data.CData.WaveFinancial.WaveFinancialParameter("@myStatus","SENT")) $cmd.ExecuteNonQuery()

Delete Wave Financial Data

PowerShell

Remove-WaveFinancial -Connection $WaveFinancial -Table "Invoices" -Id "MyId"

ADO.NET

$cmd = New-Object System.Data.CData.WaveFinancial.WaveFinancialCommand("DELETE FROM Invoices WHERE Id=@myId", $conn) $cmd.Parameters.Add(new System.Data.CData.WaveFinancial.WaveFinancialParameter("@myId","001d000000YBRseAAH")) $cmd.ExecuteNonQuery()