![]() |
VOOZH | about |
The CData Cmdlets for Greenhouse are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Greenhouse.
The Cmdlets are not only a PowerShell interface to Greenhouse, but also an SQL interface; this tutorial shows how to use both to retrieve Greenhouse data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Greenhouse. To access Greenhouse data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Greenhouse.
Once you have acquired the necessary connection properties, accessing Greenhouse data in PowerShell can be enabled in three steps.
You need an API key to connect to Greenhouse. To create an API key, follow the steps below:
Install the module:
Install-Module GreenhouseCmdlets
Connect:
$greenhouse = Connect-Greenhouse -APIKey "$APIKey"
Search for and retrieve data:
$status = "Active" $applications = Select-Greenhouse -Connection $greenhouse -Table "Applications" -Where "Status = `'$Status`'" $applications
You can also use the Invoke-Greenhouse cmdlet to execute SQL commands:
$applications = Invoke-Greenhouse -Connection $greenhouse -Query 'SELECT * FROM Applications WHERE Status = @Status' -Params @{'@Status'='Active'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Greenhouse\lib\System.Data.CData.Greenhouse.dll")
Connect to Greenhouse:
$conn= New-Object System.Data.CData.Greenhouse.GreenhouseConnection("APIKey=YourAPIKey;")
$conn.Open()
Instantiate the GreenhouseDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Id, CandidateId from Applications"
$da= New-Object System.Data.CData.Greenhouse.GreenhouseDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.id $_.candidateid
}
Download a free trial of the Greenhouse Data Provider to get started:
Download NowLearn more:
👁 Greenhouse IconRapidly create and deploy powerful .NET applications that integrate with Greenhouse.