Modules icon indicating copy to clipboard operation
Modules copied to clipboard

[SecretsManagement] [FeatureRequest] Pipeline Support and other "Powershelly" behavior

Open JustinGrote opened this issue 5 years ago • 0 comments

Summary of the new feature/enhancement

As a Powershell User, I want to be able to use pipelines to retrieve credentials and perform various manipulations using the secrets cmdlets to be more efficient

Examples: Get-SecretInfo 'MyTestSecret' | Get-Secret Get-Secret 'MyTestSecret' | Add-Secret -Name 'MyTestSecretDuplicate' Get-SecretsVault 'builtinlocalvault' | Get-SecretInfo | where typename -eq 'String' | Get-Secret Get-SecretsVault 'builtinlocalvault' | Get-Secret 'mysecret' Get-AzureVMKeyVaultName | Get-SecretsVault | Get-Secret 'myAzureKeyVaultSecret'

Proposed technical implementation details (optional)

  • ValueByPropertyName should be added to name and vault properties at a minimum
  • Cmdlets should be sensitive to the type of piped object, for instance: Get-SecretsVault 'builtinlocalvault' | Get-SecretInfo - Would recognize that it is a [SecretsVaultInfo] and bind the pipeline to the Vault parameter 'Test' | Get-SecretInfo - Would default strings and unknown types to the [String]Name parameter.
  • Objects like [SecretsVaultInfo] should have a .ToString() implemented that changes them to their vault name, so they can be coerced to the [String]$Vault parameter on Get-Secret if passed as a parameter e.g. $myvault = Get-SecretsVault Get-Secret 'mysecret' -vault $myvault

JustinGrote avatar Feb 07 '20 22:02 JustinGrote