File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 437
437
<Label >ResourceId</Label >
438
438
<PropertyName >Id</PropertyName >
439
439
</ListItem >
440
+ <ListItem >
441
+ <Label >Tags</Label >
442
+ <PropertyName >TagsTable</PropertyName >
443
+ </ListItem >
440
444
</ListItems >
441
445
</ListEntry >
442
446
</ListEntries >
Original file line number Diff line number Diff line change 16
16
using Microsoft . Azure . Commands . ResourceManager . Cmdlets . Entities . Resources ;
17
17
using Microsoft . Azure . Commands . ResourceManager . Cmdlets . Extensions ;
18
18
using Microsoft . Azure . Commands . ResourceManager . Cmdlets . SdkExtensions ;
19
+ using Microsoft . Azure . Commands . ResourceManager . Common . Tags ;
19
20
using Microsoft . Azure . Management . ResourceManager . Models ;
20
21
using Newtonsoft . Json . Linq ;
21
22
using System ;
@@ -63,6 +64,11 @@ public class PSResource
63
64
64
65
public IDictionary < string , string > Tags { get ; set ; }
65
66
67
+ public string TagsTable
68
+ {
69
+ get { return ResourcesExtensions . ConstructTagsTable ( TagsConversionHelper . CreateTagHashtable ( Tags ) ) ; }
70
+ }
71
+
66
72
public string SubscriptionId { get ; set ; }
67
73
68
74
public DateTime ? CreatedTime { get ; set ; }
Original file line number Diff line number Diff line change @@ -101,6 +101,12 @@ ResourceGroupName : testRG
101
101
ResourceType : Microsoft.Compute/virtualMachines
102
102
Location : westus
103
103
ResourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM
104
+ Tags :
105
+ Name Value
106
+ ====== ========
107
+ Dept IT
108
+ Year 2002
109
+ Status Approved
104
110
```
105
111
106
112
This command gets all of the resources whose resource name is "testVM".
@@ -142,6 +148,12 @@ ResourceGroupName : testRG
142
148
ResourceType : Microsoft.Compute/virtualMachines
143
149
Location : westus
144
150
ResourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM
151
+ Tags :
152
+ Name Value
153
+ ====== ========
154
+ Dept IT
155
+ Year 2002
156
+ Status Approved
145
157
```
146
158
147
159
This command gets the resource with the provided resource id, which is a virtual machine called "testVM" in the resource group "testRG".
You can’t perform that action at this time.
0 commit comments