Functions/PolicyACL/Get-PASPolicyACL.ps1

# .ExternalHelp psPAS-help.xml
function Get-PASPolicyACL {
    [CmdletBinding()]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [ValidateNotNullOrEmpty()]
        [string]$PolicyID

    )

    BEGIN {
        Assert-VersionRequirement -SelfHosted
    }#begin

    PROCESS {

        #Create URL for request
        $URI = "$($psPASSession.BaseURI)/WebServices/PIMServices.svc/Policy/$($PolicyID |

            Get-EscapedString)/PrivilegedCommands/"


        #Send Request to web service
        $result = Invoke-PASRestMethod -Uri $URI -Method GET

        If ($null -ne $result) {

            $result.ListPolicyPrivilegedCommandsResult |

                Add-ObjectDetail -typename psPAS.CyberArk.Vault.ACL.Policy

        }

    }#process

    END { }#end

}