Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →How to pipe Greenhouse Data to CSV in PowerShell
Use standard PowerShell cmdlets to access Greenhouse tables.
The CData Cmdlets Module for Greenhouse is a standard PowerShell module offering straightforward integration with Greenhouse. Below, you will find examples of using our Greenhouse Cmdlets with native PowerShell cmdlets.
Creating a Connection to Your Greenhouse Data
You need an API key to connect to Greenhouse. To create an API key, follow the steps below:
- Click the Configure icon in the navigation bar and locate Dev Center on the left.
- Select API Credential Management.
- Click Create New API Key.
- Set "API Type" to Harvest.
- Set "Partner" to custom.
- Optionally, provide a description.
- Proceed to Manage permissions and select the appropriate permissions based on the resources you want to access through the driver.
- Copy the created key and set APIKey to that value.
$conn = Connect-Greenhouse -APIKey "$APIKey"
Selecting Data
Follow the steps below to retrieve data from the Applications table and pipe the result into to a CSV file:
Select-Greenhouse -Connection $conn -Table Applications | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myApplicationsData.csv -NoTypeInformation
You will notice that we piped the results from Select-Greenhouse 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.