Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

After manually running Add-Secret, Get-Secret run as a script failed to retrieve the secret #32

@swinster

Description

@swinster

I suspect this will be a context issue, but would like to double check.

Steps to reproduce

Manually enter Creds:

$Creds = Get-Credentials
Add-Secret -Name MyUserCred -Secret $Creds

Then, a script that is run as part of another process/application uses:

$Creds = Get-Secret -Name $_.CredName

(where '$_.CredName returns the credential to use "MyUserCred"

Expected behavior

Credentials are found.

All is actually fine when testing with VScode manually

Actual behavior

Exception when script ran:

Get-Secret: The secret MyUserCred was not found.

Environment data

Module version:

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.2
PSEdition                      Core
GitCommitId                    7.0.0-rc.2
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions