![]() |
VOOZH | about |
The CData Cmdlets Module for IBM Cloud Object Storage is a standard PowerShell module offering straightforward integration with IBM Cloud Object Storage. Below, you will find examples of using our IBMCloudObjectStorage Cmdlets with native PowerShell cmdlets.
If you do not already have Cloud Object Storage in your IBM Cloud account, follow the procedure below to install an instance of SQL Query in your account:
There are certain connection properties you need to set before you can connect. You can obtain these as follows:
To connect with IBM Cloud Object Storage, you need an API Key. You can obtain this as follows:
If you have multiple accounts, specify the CloudObjectStorageCRN explicitly. To find the appropriate value, you can:
You can now set the following to connect to data:
When you connect, the connector completes the OAuth process.
$conn = Connect-IBMCloudObjectStorage -ApiKey "$ApiKey" -CloudObjectStorageCRN "$CloudObjectStorageCRN" -Region "$Region" -OAuthClientId "$OAuthClientId" -OAuthClientSecret "$OAuthClientSecret"
Follow the steps below to retrieve data from the Objects table and pipe the result into to a CSV file:
Select-IBMCloudObjectStorage -Connection $conn -Table Objects | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myObjectsData.csv -NoTypeInformation
You will notice that we piped the results from Select-IBMCloudObjectStorage 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 IBM Cloud Object Storage Cmdlets to get started:
Download NowLearn more:
👁 IBM Cloud Object Storage IconAn easy-to-use set of PowerShell Cmdlets offering real-time access to IBM Cloud Object Storage. The Cmdlets allow users to easily read, write, update, and delete live data - just like working with SQL server.