Public/Targets/New-SIATargetSet.ps1

function New-SIATargetSet {
    <#
    .SYNOPSIS
        Adds one or more SIA target sets in bulk.
    .DESCRIPTION
        Calls the Add a bulk of target sets operation. CyberArk's published
        request schema (TargetSetDto) was not captured in full during
        development; supply the fields it requires through -Body. This API is
        documented by CyberArk as subject to change without notice.
    .PARAMETER Body
        The request body: an array of objects matching TargetSetDto.
    .EXAMPLE
        New-SIATargetSet -Body @(@{ target_set = 'contoso.local' })

        Adds a single target set for the contoso.local domain.
    .INPUTS
        None.
    .OUTPUTS
        psSIA.TargetSet
    .LINK
        https://docs.cyberark.com/setup/latest/en/content/privileged-access/apis/dpa-target-sets.htm
    #>

    [CmdletBinding(SupportsShouldProcess)]
    [OutputType('psSIA.TargetSet')]
    param(
        [Parameter(Mandatory)]
        $Body
    )

    if ($PSCmdlet.ShouldProcess('SIA', 'Add target sets')) {
        Invoke-SIARequest -Method POST -Path '/api/targetsets/bulk' -Body $Body |
            ConvertFrom-SIAResponse -TypeName 'psSIA.TargetSet'
    }
}