Ready to get started?

Download a free trial of the Oracle HCM Cloud Data Provider to get started:

 Download Now

Learn more:

Oracle HCM Cloud Icon Oracle HCM Cloud ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Oracle HCM Cloud.

Automate Oracle HCM Cloud Integration Tasks from PowerShell



Are you in search of a quick and easy way to access Oracle HCM Cloud data from PowerShell? This article demonstrates how to utilize the Oracle HCM Cloud Cmdlets and the CData ADO.NET Provider for Oracle HCM Cloud for tasks like connecting to Oracle HCM Cloud data, automating operations, downloading data, and more.

The CData Cmdlets for Oracle HCM Cloud are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Oracle HCM Cloud.

PowerShell Cmdlets or ADO.NET Provider?

The Cmdlets are not only a PowerShell interface to Oracle HCM Cloud, but also an SQL interface; this tutorial shows how to use both to retrieve Oracle HCM Cloud data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Oracle HCM Cloud. To access Oracle HCM Cloud data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Oracle HCM Cloud.

Once you have acquired the necessary connection properties, accessing Oracle HCM Cloud data in PowerShell can be enabled in three steps.

Using Basic Authentication

You must set the following to authenticate to Oracle HCM Cloud:

  • Url: The Url of your account.
  • User: The user of your account.
  • Password: The password of your account.

PowerShell

  1. Install the module:

    Install-Module OracleHCMCmdlets
  2. Connect:

    $oraclehcm = Connect-OracleHCM -Url "$Url" -User "$User" -Password "$Password"
  3. Search for and retrieve data:

    $language = "English" $recruitingcesites = Select-OracleHCM -Connection $oraclehcm -Table "RecruitingCESites" -Where "Language = `'$Language`'" $recruitingcesites

    You can also use the Invoke-OracleHCM cmdlet to execute SQL commands:

    $recruitingcesites = Invoke-OracleHCM -Connection $oraclehcm -Query 'SELECT * FROM RecruitingCESites WHERE Language = @Language' -Params @{'@Language'='English'}

ADO.NET

  1. Load the provider's assembly:

    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Oracle HCM Cloud\lib\System.Data.CData.OracleHCM.dll")
  2. Connect to Oracle HCM Cloud:

    $conn= New-Object System.Data.CData.OracleHCM.OracleHCMConnection("Url=https://abc.oraclecloud.com;User=user;Password=password;") $conn.Open()
  3. Instantiate the OracleHCMDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT SiteId, SiteName from RecruitingCESites" $da= New-Object System.Data.CData.OracleHCM.OracleHCMDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.siteid $_.sitename }