Ready to get started?

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

 Download Now

Learn more:

Trello Icon Trello ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Trello data including Lists, Cards, Boards, and more!

Automate Trello Integration Tasks from PowerShell



Are you in search of a quick and easy way to access Trello data from PowerShell? This article demonstrates how to utilize the Trello Cmdlets for tasks like connecting to Trello data, automating operations, downloading data, and more.

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

PowerShell Cmdlets or ADO.NET Provider?

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

Once you have acquired the necessary connection properties, accessing Trello data in PowerShell can be enabled in three steps.

Trello uses token-based authentication to grant third-party applications access to their API. When a user has granted an application access to their data, the application is given a token that can be used to make requests to Trello's API.

Trello's API can be accessed in 2 different ways. The first is using Trello's own Authorization Route, and the second is using OAuth1.0.

  • Authorization Route: At the moment of registration, Trello assigns an API key and Token to the account. See the Help documentation for information on how to connect via the Authorization route.
  • OAuth Route: Similar to using Authorization, OAuth creates an Application Id and Secret when you create your account. See the Help documentation for information on how to to connect.

PowerShell

  1. Install the module:

    Install-Module TrelloCmdlets
  2. Connect:

    $trello = Connect-Trello -APIKey "$APIKey" -Token "$Token"
  3. Search for and retrieve data:

    $name = "Public Board" $boards = Select-Trello -Connection $trello -Table "Boards" -Where "Name = `'$Name`'" $boards

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

    $boards = Invoke-Trello -Connection $trello -Query 'SELECT * FROM Boards WHERE Name = @Name' -Params @{'@Name'='Public Board'}

ADO.NET

  1. Load the provider's assembly:

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

    $conn= New-Object System.Data.CData.Trello.TrelloConnection("APIKey=myApiKey;Token=myGeneratedToken;InitiateOAuth=GETANDREFRESH") $conn.Open()
  3. Instantiate the TrelloDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT BoardId, Name from Boards" $da= New-Object System.Data.CData.Trello.TrelloDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.boardid $_.name }