Secrets need to be Secret
As a PowerShell user
When I want to add a secret
I should not enter it visibly in the console
If I call Add-Secret Password, I obviously don't want to enter the password visibly in the console, but currently the mandatory Secret parameter prompts for a plain text string. It should prompt for the secret as a SecureString.
Proposed technical implementation details
I understand you want to accept a PSCredential or even a byte array ...
But if we're prompting the user for the value of a mandatory parameter, then it's inherently text, so the prompt should use the SecureString input.
The simplest implementation of this is to just have two parameter sets, where the default one has a mandatory SecureString parameter, and the other one accepts an object so you can pass other types.
Add-Secret [-Name] <string> [-SecureString] <SecureString> [[-Vault] <string>] [-NoClobber]
Add-Secret [-Name] <string> [-Secret] <Object> [[-Vault] <string>] [-NoClobber]
Note that currently, the only option is for the user to actually write all of this:
Add-Secret Password (Read-Host Password -AsSecureString)