I have an Azure Pipeline which runs the following command to install the Az.KeyVault module, before going on to run another script (list-keyvault-secrets.ps1) where the installed KeyVault module gets called.
The module gets installed successfully, however when the powershell script that follows gets run, the pipeline fails and displays the below error message.
This is an example of one of the lines of code where the Get-AzKeyVaultSecret command is called:
$plainTxtSecret = Get-AzKeyVaultSecret -VaultName $srckvName -Name $name -AsPlainText
Any idea what could be causing this error and how I can resolve it?

