Cmdlets for Oracle Fusion Cloud HCM

Build 25.0.9434

Establishing a Connection

With the CData Cmdlets users can install a data module, set the connection properties, and start scripting. This section provides examples of using our OracleHCM Cmdlets with native PowerShell cmdlets, like the CSV import and export cmdlets.

Connecting to Oracle Fusion Cloud HCM Cloud

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

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

Creating a Connection Object

You can then use the Connect-OracleHCM cmdlet to create a connection object that can be passed to other cmdlets:

$conn = Connect-OracleHCM -Url "https://abc.oraclecloud.com" -User "user" -Password "password" 

Retrieving Data

The Select-OracleHCM cmdlet provides a native PowerShell interface for retrieving data:

$results = Select-OracleHCM -Connection $conn -Table "RecruitingCESites" -Columns @("SiteId, SiteName") -Where "SiteName='Bob'"
The Invoke-OracleHCM cmdlet provides an SQL interface. This cmdlet can be used to execute an SQL query via the Query parameter.

Piping Cmdlet Output

The cmdlets return row objects to the pipeline one row at a time. The following line exports results to a CSV file:

Select-OracleHCM -Connection $conn -Table RecruitingCESites -Where "SiteName = 'Bob'" | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myRecruitingCESitesData.csv -NoTypeInformation

You will notice that we piped the results from Select-OracleHCM 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 object in the result set, and we do not necessarily want that information in our CSV file.

However, this makes it easy to pipe the output of one cmdlet to another. The following is an example of converting a result set to JSON:

 
PS C:\> $conn  = Connect-OracleHCM -Url "https://abc.oraclecloud.com" -User "user" -Password "password" 
PS C:\> $row = Select-OracleHCM -Connection $conn -Table "RecruitingCESites" -Columns (SiteId, SiteName) -Where "SiteName = 'Bob'" | select -first 1
PS C:\> $row | ConvertTo-Json
{
  "Connection":  {

  },
  "Table":  "RecruitingCESites",
  "Columns":  [

  ],
  "SiteId":  "MySiteId",
  "SiteName":  "MySiteName"
} 

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434