Write-Output secrets from a Keyvault into my script

Hello,

I can’t display the secrets in my script. I’ve tried many different ways, and the variables are always empty. Everything is OK in the variable parameters and in my Key Vault.

Below are my attempts

Write-Output $Yvar1
Write-Output $Secret:Yvar1
Write-Output $Yvar2
Write-Output $Secret:Yvar2
Write-Output $Secret:Yvar
Write-Output $Secret:YvarCred.UserName
Write-Output $Secret:YvarCred.Password

Can you help me? Thank you in advance.

Product: PowerShell Universal
Version: 4.2.10