Functions/AccountACL/Get-PASAccountACL.ps1

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

        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [Alias("Address")]
        [ValidateNotNullOrEmpty()]
        [string]$AccountAddress,

        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [Alias("UserName")]
        [ValidateNotNullOrEmpty()]
        [string]$AccountUserName
    )

    BEGIN { }#begin

    PROCESS {

        #Create URL for request
        $URI = "$Script:BaseURI/WebServices/PIMServices.svc/Account/$($AccountAddress |

            Get-EscapedString)|$($AccountUserName |

                Get-EscapedString)|$($AccountPolicyId |

                    Get-EscapedString)/PrivilegedCommands"


        #Send request to Web Service
        $result = Invoke-PASRestMethod -Uri $URI -Method GET -WebSession $Script:WebSession #DevSkim: ignore DS104456

        If ($null -ne $result) {

            $result.ListAccountPrivilegedCommandsResult |

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

        }

    }#process

    END { }#end

}