Get-PASAccount -search is used to get an account ID that is later passed to Get-PASAccountPassword to retrieve the credential. Get-Secret is meant to return only a single Secret but depending on the search Get-PASAccount can return more than one result so we just return the first one. As an account's name property is, by default, not searchable via the CyberArk API it can be very difficult to craft a search query that returns exactly one account.
Ideas
psPAS.CyberArk.Vault.Account.V10 in pipeline
It would be convenient to be able to pass a [psPAS.CyberArk.Vault.Account.V10] to Get-Secret which would then get the credential for that account.
Allow Get-PASAccount parameters to be passed in AdditionalParameters for Get-Secret
Get-PASAccount enables a person to pass multiple parameters that could result in a single account being returned. We should enable users to pass the same parameters they are familiar with from Get-PASAccount in AdditionalParameters.
Problem
Get-PASAccount -search
is used to get an account ID that is later passed toGet-PASAccountPassword
to retrieve the credential.Get-Secret
is meant to return only a single Secret but depending on the searchGet-PASAccount
can return more than one result so we just return the first one. As an account's name property is, by default, not searchable via the CyberArk API it can be very difficult to craft a search query that returns exactly one account.Ideas
psPAS.CyberArk.Vault.Account.V10
in pipelineIt would be convenient to be able to pass a
[psPAS.CyberArk.Vault.Account.V10]
to Get-Secret which would then get the credential for that account.Example
Get-PASAccount -search root | Where-Object {$_.address -eq 'specificServer2'} | Get-Secret -AdditionalParameters @{Reason='Maintenance task'}
Allow
Get-PASAccount
parameters to be passed inAdditionalParameters
forGet-Secret
Get-PASAccount
enables a person to pass multiple parameters that could result in a single account being returned. We should enable users to pass the same parameters they are familiar with fromGet-PASAccount
inAdditionalParameters
.Example
Get-Secret -Name admin -AdditionalParameters @{searchType='startswith'}