pspete / psPAS

PowerShell module for CyberArk Privileged Access Security REST API
https://pspas.pspete.dev
MIT License
286 stars 90 forks source link

Request to add Add-ObjectDetail as a public function #452

Closed Ethlas closed 1 year ago

Ethlas commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] We want to allow a module in https://github.com/cyberark/epv-api-scripts to work with psPAS. The module is Identity authentication.

Describe the solution you'd like It will be great if we can request psPAS module to be imported before importing the module (https://github.com/cyberark/epv-api-scripts/tree/main/Identity%20Authentication) to be used for psPAS.

Describe alternatives you've considered We thought about just creating our own function. But if it is maintained already in this module and we are using it just to interact with this module it will be simpler to pull it.

Additional context

pspete commented 1 year ago

Hi @Ethlas - Add-ObjectDetail is borrowed from RamblingCookieMonster's repo here: https://github.com/RamblingCookieMonster/PowerShell/blob/master/Add-ObjectDetail.ps1

They also wrote a companion blog post on its usage: http://ramblingcookiemonster.github.io/Decorating-Objects/

Is my assumption correct that you are wanting to set a custom type name so that the output of the Identity Authentication module can be consumed by the Use-PASSession command in psPAS? If so, may be simpler to achieve with Add-Member

Add-Member -InputObject $obj -TypeName Some.New.Type.Name
pspete commented 1 year ago

Closing for now... as normal module user interaction does not require the command to be invoked, it is unlikely to be made public as a module command.