-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Description
Get-AzKeyVaultSecret and other cmdlets returning Key Vault resources return raw DateTime properties that are in UTC. This differs from the az CLI that converts to local time.
Steps to reproduce
- Create or use a Key Vault in which you have secret/set access.
- Run the following:
Set-AzKeyVaultSecret -VaultName example-keyvault -Name test -SecretValue (ConvertTo-SecureString -String 'test' -AsPlainText -Force)
Vault Name : example-keyvault
Name : test
Version : 0a1b2177d4ec4e94b44f4239232474c3
Id : https://example-keyvault.vault.azure.net:443/secrets/test/0a1b2177d4ec4e94b44f4239232474c3
Enabled : True
Expires :
Not Before :
Created : 11/20/2019 6:08:55 PM
Updated : 11/20/2019 6:08:55 PM
Content Type :
TagsNotice the Created and Updated times. These are UTC, while my local system time was 10:08 AM.
I recommend either converting the DateTime values to local time (should contain correct time zone info), and back (for anything serialized), similar to the az CLI for a common developer experience.
Environment data
Name Value
---- -----
PSVersion 6.2.3
PSEdition Core
GitCommitId 6.2.3
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Module versions
ModuleType Version Name PSEdition ExportedCommands
---------- ------- ---- --------- ----------------
Script 2.8.0 Az Core,Desk
Script 1.3.1 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertif…