psPAS icon indicating copy to clipboard operation
psPAS copied to clipboard

Get-PASSafe -search xxx-sort asc fails

Open begunrom opened this issue 1 year ago • 0 comments

Get-PASSafe -search xxx-sort asc fails with

`Invoke-PASRestMethod : [400] Cannot sort by a property other than [safename, managingcpm]. At line:230 char:13

  • ... $result = Invoke-PASRestMethod -Uri $URI -Method GET -WebSession $S ...
    • CategoryInfo : NotSpecified: ({"ErrorCode":"P...managingcpm]."}:ErrorRecord) [Invoke-PASRestMethod], Exception
    • FullyQualifiedErrorId : PASWS014E,Invoke-PASRestMethod`

The parameters on the function force you to either select asc or desc, while the rest call expects safename or managingcpm

`PS C:\Users\adm-guro> Get-PASSafe -search XXX -sort managingcpm Get-PASSafe : Cannot validate argument on parameter 'sort'. The argument "managingcpm" does not belong to the set "asc,desc" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. At line:1 char:31

  • Get-PASSafe -search XXX -sort managingcpm
    • CategoryInfo : InvalidData: (:) [Get-PASSafe], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Get-PASSafe`

Your Environment

  • psPAS Version: v6.4.85
  • CyberArk Version: 14.0

begunrom avatar Jun 17 '24 07:06 begunrom