![]() |
VOOZH | about |
The CData Cmdlets Module for Google Cloud Storage is a standard PowerShell module offering straightforward integration with Google Cloud Storage. Below, you will find examples of using our GoogleCloudStorage Cmdlets with native PowerShell cmdlets.
You can connect without setting any connection properties for your user credentials. After setting InitiateOAuth to GETANDREFRESH, you are ready to connect.
When you connect, the Google Cloud Storage OAuth endpoint opens in your default browser. Log in and grant permissions, then the OAuth process completes
Service accounts have silent authentication, without user authentication in the browser. You can also use a service account to delegate enterprise-wide access scopes.
You need to create an OAuth application in this flow. See the Help documentation for more information. After setting the following connection properties, you are ready to connect:
The OAuth flow for a service account then completes.
$conn = Connect-GoogleCloudStorage -ProjectId "$ProjectId" -InitiateOAuth "$InitiateOAuth"
Follow the steps below to retrieve data from the Buckets table and pipe the result into to a CSV file:
Select-GoogleCloudStorage -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-GoogleCloudStorage 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.Download a free trial of the Google Cloud Storage Cmdlets to get started:
Download NowLearn more:
👁 Google Cloud Storage IconAn easy-to-use set of PowerShell Cmdlets offering real-time access to Google Cloud Storage. The Cmdlets allow users to access live data - just like working with SQL server.