We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-AzKeyVaultSecret
The way our current example converts secure string secret to plain text secret does not work in PowerShell constrained language mode, because
Only allowed types (listed below) can be used in PowerShell. Other types are not permitted. (See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.1#constrained-language-constrained-language)
and System.Runtime.InteropServices.Marshal is not in the the list.
System.Runtime.InteropServices.Marshal
@TylerLeonhardt suggested a work-around by using PSCredential class (thanks Tyler!)
PSCredential
$securestr = (Get-AzKeyVaultSecret -Name Foo -VaultName bar).SecretText [pscredential]::new("DoesntMatter", $securestr).GetNetworkCredential().Password
ConvertFrom-SecureString -AsPlainText
1
The text was updated successfully, but these errors were encountered:
isra-fel
Successfully merging a pull request may close this issue.
Description
The way our current example converts secure string secret to plain text secret does not work in PowerShell constrained language mode, because
and
System.Runtime.InteropServices.Marshal
is not in the the list.@TylerLeonhardt suggested a work-around by using
PSCredential
class (thanks Tyler!)What to do
ConvertFrom-SecureString -AsPlainText
in PowerShell 7Cost
1
The text was updated successfully, but these errors were encountered: