Ready to get started?

Learn more about the Alfresco PowerShell Cmdlets or download a free trial:

Download Now

PowerShell でAlfresco Data データをCSV に落としてみた

標準PowerShell cmdlets を使ってAlfresco テーブルにアクセス。

CData Cmdlets Module for Alfresco は、直感的なAlfresco データ連携を提供する標準cmdlet です。 本記事では、Alfresco Cmdlets を使ったサンプルを提供します。

Creating a Connection to Your Alfresco Data

To connect to Alfresco, the following connection properties must be supplied: User, Password, and InstanceUrl. User and Password correspond to the login credentials that you use to access Alfresco in a web browser. InstanceUrl corresponds to the Alfresco instance you will be querying. For instance, if you expect your queries to hit https://search-demo.dev.alfresco.me/alfresco/api/-default-/public/search/versions/1/sql, you should supply search-demo.dev.alfresco.me for InstanceUrl.

$conn = Connect-Alfresco  -User "$User" -Password "$Password" -Format "$Format" -InstanceUrl "$InstanceUrl"

Selecting Data

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

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

You will notice that we piped the results from Select-Alfresco 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.
 
 
ダウンロード