A PowerShell module that simplifies working with the Salesforce Scripted Data Loader.
It provides a clean command-line interface for running Data Loader jobs without manually creating XML configuration files or relying on the GUI.
Salesforce Data Loader offers two usage modes:
- GUI mode – easy to use, but limited when it comes to repeatable or automated tasks.
- Scripted mode (a.k.a. Scripted Data Loader) – powerful, but requires hand-crafted XML configuration files and is inflexible for ad‑hoc changes.
This module fills the gap by enabling you to run Salesforce Data Loader directly from the PowerShell command line (What is PowerShell?) — ideal for both ad‑hoc operations and repeatable automation.
It provides:
- Straightforward commands and easy-to-remember aliases for EXTRACT, INSERT, UPDATE, UPSERT, and (HARD) DELETE
- Simple switching between SOAP API and Bulk API (serial or parallel), including command-line control of batch size
- Automatic creation of mapping files in many scenarios
- Encapsulated Salesforce authentication, including
- generating key files and encrypted password storage (username + password + security token),
- optional reuse of authentication handled by the Salesforce SFDX CLI
- Full PowerShell integration: help pages, tab completion, approved verbs, and consistent command naming
For more examples and command reference, see the Wiki Pages.
Using the default org of your SFDX project:
$MySourceOrg = sfauthExample for a Sandbox org, prompting for password and security token:
$MyTargetOrg = sfauth MyUserName@MyCompanyName.com -ConsoleInput -InstanceUrl https://test.salesforce.comExtracts all Leads into the file Lead.csv - that is the default file name derived from the Object Name.
sfextract $MySourceOrg Lead "SELECT Id, FirstName, LastName, Company FROM Lead"Imports the Leads from Lead.csv.
A default mapping file (.sdl) is automatically created based on the CSV headers:
sfinsert $MyTargetOrg LeadMandatory
- Windows 10 or newer with PowerShell v5.1 or newer. NOTE: v5.1 is already installed by default on Windows 10 and newer. For further details see Installing Windows PowerShell
- A Java Runtime Environment (JRE) version 11 or later as described in Considerations for Installing Data Loader, e.g. Zulu OpenJDK. Make sure that the JAVA_HOME environment variable is set properly.
- A download of the latest Salesforce Data Loader .zip file from https://developer.salesforce.com/tools/data-loader or from https://github.com/forcedotcom/dataloader/releases. NOTE: There is no need to run the installation batch file from inside the .zip. This would only be needed if you also want to use Data Loader independently of the SfDataloaderCli module.
- Make sure, you have got the proper permissions in your Salesforce Org as described in Salesforce Data Loader Installation Considerations.
Optionally
- Salesforce CLI if you want to use the authentication methods provided by SFDX.
- Download the .zip file of the latest stable version from Releases.
- Extract the files to a target directory of your choice, e.g.
D:\sf-dataloader-cli-0.0.1-beta - From the Data Loader .zip file (see prerequisites above), locate the Data Loader .jar file: e.g. in the
dataloader_v58.0.2.zipthis would be the filedataloader_v58.0.2.jar. - Copy this .jar file to the corresponding directory in the PowerShell module directory, e.g. to
D:\sf-dataloader-cli-0.0.1-beta\dataloader
- Open a PowerShell console window.
- Run
Import-Module D:\sf-dataloader-cli-0.0.1-beta\dataloader\SfDataloaderCli.psd1.
See the Wiki Pages on how to get started.