Skip to content

Get-Secret asking for Vault password in PowerShell 7.1.1 but not in WSL2 #100

@MaximoTrinidad

Description

@MaximoTrinidad

I'm wondering if this is by design or a bug. I kind of like to have the ability to get the secrets without the password to the vault but if it's a requirement then why not provide a parameter for the vault password via a prompt.

I use the following oneliners to repo the issue I'm experiencing:

Set-secret -name sqladmin01cred -secret '$SqlPwd01!';
$sqlcred = Get-secret -Name sqladmin01cred -AsPlainText;

In PowerShell 7..1.1:

PS C:\Windows\System32> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.1
PSEdition                      Core
GitCommitId                    7.1.1
OS                             Microsoft Windows 10.0.21301
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\Windows\System32>

secretpwh711_01_2021-02-01_11-17-44

In WSL2 PowerShell 7.1.1:

PS /home/max_t> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.1
PSEdition                      Core
GitCommitId                    7.1.1
OS                             Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

secretWSL2pwsh_01_2021-02-01_11-16-19

Modules version;

PS C:\Windows\System32> get-module -l *secret* | select name, version

Name                                  Version
----                                  -------
Microsoft.PowerShell.SecretManagement 0.5.5
Microsoft.PowerShell.SecretStore      0.5.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions