Failed: The term 'Get-UASecretManager' is not recognized as the name of a cmdlet

Link to Docs

Example 2
PS C:\> $SecretManager = Get-UASecretManager -Name 'Vault'
PS C:\> New-UAVariable -Name 'UserName' -Value 'Adam' -SecretManager $SecretManager

How do you create/update variables with the SECRET type with the BuiltInLocalVault?

This is a bug in the docs. I’ve resolved it.

You can just use the vault parameter.

New-UAVariable -Name 'UserName' -Value 'Adam' -Vault 'BuiltInVault'

Running the following:

New-UAVariable -Name $VarName -Value $FullToken -Vault 'BuiltInVault'

I receive the following

[error] Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided. 

Is the error coming from the vault value? Note: im just using the default vault

Ack. I see what’s happening here. We have a bug in the cmdlet parameterset where if you specify the vault, it’s not allowing you to specify the value.

To work around this, you should be able to use the REST API directly.

Invoke-RestMethod http://localhost:5000 -Headers @{ Authorization = "Bearer $appToken" } -Body @{
   name = $VarName 
   vault = "BuiltInVault" 
   value = $FullToken
   type = "String" 

I’ll open an issue for this cmdlet so you won’t need to do this in the future.

I could probably wait till the fix gets released.

Also can you update secrets with Set-UAVariable? Or would I have to remove the variable and create a new secret?

You can’t update secrets at the moment but that could easily be added. I’ll open an issue for it.

1 Like

Hi there,

question on that issue. With 2.1.2 is this related why I’m not able to add new secrets to my IIS instace with a LocalSystem app pool?

Best regards,

You should be able to add secrets. This is different. What is your experience when you try to add a secret?

I’m not seeing the BultInLocalVault, as you can see on this screenshot: