File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
documentation/migration-guides Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,8 @@ The ability to update soft-delete setting is deprecated in Az.KeyVault 3.0.0. Re
237237### Get-AzKeyVaultSecret
238238
239239The property ` SecretValueText ` of type ` Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret `
240- has been removed. The ` SecretValueText ` property has been replaced with ` SecretValue ` .
240+ has been removed. Either apply a ` -AsPlainText ` to the call to get the plain text secret,
241+ or use ` $secret.SecretValue ` of type ` SecureString ` in your script.
241242
242243#### Before
243244
@@ -249,13 +250,7 @@ $secretInPlainText = $secret.SecretValueText
249250#### After
250251
251252``` powershell
252- # PowerShell 7 or newer
253- $secret = Get-AzKeyVaultSecret -VaultName myVault -Name mySecret
254- $secretInPlainText = ConvertFrom-SecureString -SecureString $secret.SecretValue -AsPlainText
255-
256- # Prior to PowerShell 7, or Windows PowerShell
257- $secret = Get-AzKeyVaultSecret -VaultName myVault -Name mySecret
258- $secretInPlainText = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secret.SecretValue))
253+ $secretInPlainText = Get-AzKeyVaultSecret -VaultName myVault -Name mySecret -AsPlainText
259254```
260255
261256## Az.ManagedServices
You can’t perform that action at this time.
0 commit comments