Ready to get started?

Download a free trial of the Google Data Catalog Cmdlets to get started:

 Download Now

Learn more:

Google Data Catalog Icon Google Data Catalog Data Cmdlets

An easy-to-use set of PowerShell Cmdlets offering real-time access to Google Data Catalog. The Cmdlets allow users to easily read, write, update, and delete live data - just like working with SQL server.

How to pipe Google Data Catalog Data to CSV in PowerShell

Use standard PowerShell cmdlets to access Google Data Catalog tables.

The CData Cmdlets Module for Google Data Catalog is a standard PowerShell module offering straightforward integration with Google Data Catalog. Below, you will find examples of using our GoogleDataCatalog Cmdlets with native PowerShell cmdlets.

Creating a Connection to Your Google Data Catalog Data

Google Data Catalog uses the OAuth authentication standard. Authorize access to Google APIs on behalf on individual users or on behalf of users in a domain.

Before connecting, specify the following to identify the organization and project you would like to connect to:

  • OrganizationId: The ID associated with the Google Cloud Platform organization resource you would like to connect to. Find this by navigating to the cloud console.

    Click the project selection drop-down, and select your organization from the list. Then, click More -> Settings. The organization ID is displayed on this page.

  • ProjectId: The ID associated with the Google Cloud Platform project resource you would like to connect to.

    Find this by navigating to the cloud console dashboard and selecting your project from the Select from drop-down. The project ID will be present in the Project info card.

When you connect, the OAuth endpoint opens in your default browser. Log in and grant permissions to the application to completes the OAuth process. For more information, refer to the OAuth section in the Help documentation.

$conn = Connect-GoogleDataCatalog  -ProjectId "$ProjectId"

Selecting Data

Follow the steps below to retrieve data from the Schemas table and pipe the result into to a CSV file:

Select-GoogleDataCatalog -Connection $conn -Table Schemas | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\mySchemasData.csv -NoTypeInformation

You will notice that we piped the results from Select-GoogleDataCatalog 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.