PowerShell / SecretManagement

PowerShell module to consistent usage of secrets through different extension vaults
MIT License
335 stars 47 forks source link

Designdoc - Verbose implementation. #75

Closed itfranck closed 4 years ago

itfranck commented 4 years ago

I was looking at the changelog and saw something was done for verbose.

Can't the flag be passed down normally through the calling cmdlet ? For instance,

Get-Secret -Name 'SuperSecret' -AsPlainText -vault MyVault -Verbose

I would expect that verbose flag to be passed down to the implementing module, not a flag that need to be defined in VaultParameters. (And following that logic, it should be possible to pass the -debug flag in the same manner).

With #66 , it seems that I need to unregister the vault, then register it again with verbose, then unregister / re-register it again when done. It feels like we're going the long way around.

PaulHigin commented 4 years ago

Yes, the -Verbose flag is now passed to the extension vault cmdlets as part of the AdditionalParameters parameters. This is done automatically, you do not have to add them to the VaultParameters field when registering an extension vault.

However, you do have to look for the Verbose parameter in AdditionalParameters in your extension vault cmdlets, and set $VerbosePreference accordingly so that verbose output is written.

itfranck commented 4 years ago

@PaulHigin Yup, I see that now and it work as expected.

Maybe it should be added in the DesignDoc then ?

I edited the title of this ticket to reflect that need.

PaulHigin commented 4 years ago

Fixed.