Get-PSUVariable to get Secret

Get-PSUVariable to get Secret

avatar
(anonymous user)

Hi

I am trying the following in a PowerShell (not in an API Endpoint or PSU-Script)

Connect-PSUServer -ComputerName “https://mypsuserver.domain” -UseDefaultCredentials

$secretVar = Get-PSUVariable -Name “MySecretVar” -UseDefaultCredentials
$secretVar.Value

Output
‘****’ (4 asterix)

I would have expected the secret.

Get-ChildItem “Secret:\MySecretVar” doesn’t work neither.

With Get-PSDrive / Get-PSProvider I can see that there is a “Secret” drive/provider but they seem not to be populated.

Is it possible to access PSU-Variables this way from a Powershell by connecting to PSU-Server and use Get-PSUVariable? Or are they valid only inside API endpoints and PSU-Scripts ?

Regards,
Oliver

Product: PowerShell Universal
Version: 4.2.13


All Comments (2)

avatar

We never return the value of secrets from the API. They are only accessible within PSU.

You could create an API endpoint to do this but that could be considered a security issue.

Adam Driscoll
PowerShell Expert and Developer at Devolutions

avatar

Understood. And you are absolutely right about security.

Regards,
Oliver