![]() |
VOOZH | about |
The CData Cmdlets Module for Sage 300 is a standard PowerShell module offering straightforward integration with Sage 300. Below, you will find examples of using our Sage300 Cmdlets with native PowerShell cmdlets.
Sage 300 requires some initial setup in order to communicate over the Sage 300 Web API.
Authenticate to Sage 300 using Basic authentication.
You must provide values for the following properties to successfully authenticate to Sage 300. Note that the provider reuses the session opened by Sage 300 using cookies. This means that your credentials are used only on the first request to open the session. After that, cookies returned from Sage 300 are used for authentication.
$conn = Connect-Sage300 -User "$User" -Password "$Password" -URL "$URL" -Company "$Company"
Follow the steps below to retrieve data from the OEInvoices table and pipe the result into to a CSV file:
Select-Sage300 -Connection $conn -Table OEInvoices | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myOEInvoicesData.csv -NoTypeInformation
You will notice that we piped the results from Select-Sage300 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 Sage 300 Cmdlets to get started:
Download NowLearn more:
👁 Sage 300 IconAn easy-to-use set of PowerShell Cmdlets offering real-time access to Sage 300. The Cmdlets allow users to easily read, write, update, and delete live data - just like working with SQL server.