$Secret scope not available

Product: PowerShell Universal
Version: 5.0.16

I just set up the product using a docker container and SQL persistence. I am unable to find or access the $Secret scope within a script.

I created a secret in the variables area, called it “vcCredential”, saved it in the Database vault (the only vault available). I see it in the variables.ps1 file. The variable is configured without any roles.

When I run a script, there is no $Secret scope. My other non-secret variabe is present. I am running the script in the PowerShell7 environment, which has the * in the variables field configured. I am trying to access the variable with the following line:

$Secret:vcCredential.UserName

Update: If I run the following command:

Get-ChildItem "Secret"

I get the following output:

Cannot find path '/home/data/Repository/Secret' because it does not exist.

See Import-PSUSecret? - #11 by dcssoe

Hey, that worked! One caveat - I couldn’t “Edit Properties” - that didn’t help. I had to “Set Secret Value”. I even saw the new encrypted value pop into the Variables table of the database.

1 Like