PowerShell / Modules

MIT License
112 stars 25 forks source link

The Add-Secret doesn't appear to be working for hashtables #29

Closed err-unknown-username closed 4 years ago

err-unknown-username commented 4 years ago

The Add-Secret doesn't appear to be working for hashtables:

10:06:54 .\Desktop > Add-Secret -Name 'test' -Secret (@{a=123; b='abc'})
Add-Secret : The object type for a Hashtable entry is not supported. Supported types are byte[], string, SecureString, PSCredential
At line:1 char:1
+ Add-Secret -Name 'test' -Secret (@{a=123; b='abc'})
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Secret], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.SecretsManagement.AddSecretCommand

10:06:59 .\Desktop > Get-Module Microsoft.PowerShell.SecretsManagement 

ModuleType Version    Name                                ExportedCommands                                                                  
---------- -------    ----                                ----------------                                                                  
Binary     0.1.0      Microsoft.PowerShell.SecretsMana... {Add-Secret, Get-Secret, Get-SecretInfo, Get-SecretsVault...}                     
PaulHigin commented 4 years ago

The hash table elements are restricted to the allowed Secret types. For more information, see: https://github.com/PowerShell/Modules/blob/master/Modules/Microsoft.PowerShell.SecretsManagement/Docs/DesignDoc.md