Pipe Wasabi Data to CSV in PowerShell

Ready to get started?

Download for a free trial:

Download Now

Learn more:

Wasabi Cmdlets

An easy-to-use set of PowerShell Cmdlets offering real-time access to Wasabi data. The Cmdlets allow users to easily access live data - just like working with SQL server.

Use standard PowerShell cmdlets to access Wasabi tables.

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

Creating a Connection to Your Wasabi Data

To authorize Wasabi requests, provide the credentials for an administrator account or for an IAM user with custom permissions. Set AccessKey to the access key Id. Set SecretKey to the secret access key.

Note: You can connect as the AWS account administrator, but it is recommended to use IAM user credentials to access AWS services.

For information on obtaining the credentials and other authentication methods, refer to the Getting Started section of the Help documentation.

$conn = Connect-Wasabi  -AccessKey "$AccessKey" -SecretKey "$SecretKey"

Selecting Data

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

Select-Wasabi -Connection $conn -Table Buckets | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myBucketsData.csv -NoTypeInformation

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