Skip to content

Commit

Permalink
change logic of 'createtime' and 'changetime' for get-azresource (#18293
Browse files Browse the repository at this point in the history
)

* add createtime and changetime for get-azresource

* add changelog for change
  • Loading branch information
Nickcandy authored May 25, 2022
1 parent 0911701 commit 2a5ad3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ public PSResource(Resource<JToken> resource): this(
TagsHelper.GetTagsDictionary(TagsHelper.GetTagsHashtable(resource.Tags))
)
{
this.CreatedTime = resource.CreatedTime;
this.ChangedTime = resource.ChangedTime;

if ( resource.Properties["creationTime"] == null) { this.CreatedTime = null;} else {this.CreatedTime = Convert.ToDateTime(resource.Properties["creationTime"]);}
if ( resource.Properties["lastModifiedTime"] == null) { this.ChangedTime = null;} else {this.ChangedTime = Convert.ToDateTime(resource.Properties["lastModifiedTime"]);}
this.SubscriptionId = string.IsNullOrEmpty(resource.Id) ? null : ResourceIdUtility.GetSubscriptionId(resource.Id);
this.ResourceGroupName = string.IsNullOrEmpty(resource.Id) ? null : ResourceIdUtility.GetResourceGroupName(resource.Id);
this.ExtensionResourceName = string.IsNullOrEmpty(resource.Id) ? null : ResourceIdUtility.GetExtensionResourceName(resource.Id);
Expand Down
1 change: 1 addition & 0 deletions src/Resources/Resources/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->

## Upcoming Release
* Fixed logic of `createtime` and `ChangedTime` in `Get-AzResource --ExpandProperties`. [#18206]

## Version 6.0.0
* Added cmdlet for Application federated identity credential
Expand Down

0 comments on commit 2a5ad3b

Please sign in to comment.