Ready to get started?

Download a free trial of the Wave Financial Data Provider to get started:

 Download Now

Learn more:

Wave Financial Icon Wave Financial ADO.NET Provider

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

Automate Wave Financial Integration Tasks from PowerShell



Are you in search of a quick and easy way to access Wave Financial data from PowerShell? This article demonstrates how to utilize the Wave Financial Cmdlets for tasks like connecting to Wave Financial data, automating operations, downloading data, 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.

PowerShell Cmdlets or ADO.NET Provider?

The Cmdlets are not only a PowerShell interface to Wave Financial, 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.

Once you have acquired the necessary connection properties, accessing Wave Financial data in PowerShell can be enabled in three 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-Object 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-Object 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-Object System.Data.CData.WaveFinancial.WaveFinancialParameter("@myId","001d000000YBRseAAH"))) $cmd.ExecuteNonQuery()