@@ -16,31 +16,31 @@ Modifies a policy definition.
16
16
### NameParameterSet (Default)
17
17
```
18
18
Set-AzureRmPolicyDefinition -Name <String> [-DisplayName <String>] [-Description <String>] [-Policy <String>]
19
- [-Metadata <String>] [-Parameter <String>] [-ApiVersion <String>] [-Pre]
19
+ [-Metadata <String>] [-Parameter <String>] [-Mode <PolicyDefinitionMode>] [- ApiVersion <String>] [-Pre]
20
20
[-DefaultProfile <IAzureContextContainer>] [-InformationAction <ActionPreference>]
21
21
[-InformationVariable <String>] [<CommonParameters>]
22
22
```
23
23
24
24
### ManagementGroupNameParameterSet
25
25
```
26
26
Set-AzureRmPolicyDefinition -Name <String> [-DisplayName <String>] [-Description <String>] [-Policy <String>]
27
- [-Metadata <String>] [-Parameter <String>] -ManagementGroupName <String> [-ApiVersion <String>] [-Pre]
28
- [-DefaultProfile <IAzureContextContainer >] [-InformationAction <ActionPreference >]
29
- [-InformationVariable <String>] [<CommonParameters>]
27
+ [-Metadata <String>] [-Parameter <String>] [-Mode <PolicyDefinitionMode>] -ManagementGroupName <String>
28
+ [-ApiVersion <String >] [-Pre] [-DefaultProfile <IAzureContextContainer >]
29
+ [-InformationAction <ActionPreference>] [- InformationVariable <String>] [<CommonParameters>]
30
30
```
31
31
32
32
### SubscriptionIdParameterSet
33
33
```
34
34
Set-AzureRmPolicyDefinition -Name <String> [-DisplayName <String>] [-Description <String>] [-Policy <String>]
35
- [-Metadata <String>] [-Parameter <String>] -SubscriptionId <Guid> [-ApiVersion <String>] [-Pre]
36
- [-DefaultProfile <IAzureContextContainer >] [-InformationAction <ActionPreference >]
37
- [-InformationVariable <String>] [<CommonParameters>]
35
+ [-Metadata <String>] [-Parameter <String>] [-Mode <PolicyDefinitionMode>] -SubscriptionId <Guid>
36
+ [-ApiVersion <String >] [-Pre] [-DefaultProfile <IAzureContextContainer >]
37
+ [-InformationAction <ActionPreference>] [- InformationVariable <String>] [<CommonParameters>]
38
38
```
39
39
40
40
### IdParameterSet
41
41
```
42
42
Set-AzureRmPolicyDefinition -Id <String> [-DisplayName <String>] [-Description <String>] [-Policy <String>]
43
- [-Metadata <String>] [-Parameter <String>] [-ApiVersion <String>] [-Pre]
43
+ [-Metadata <String>] [-Parameter <String>] [-Mode <PolicyDefinitionMode>] [- ApiVersion <String>] [-Pre]
44
44
[-DefaultProfile <IAzureContextContainer>] [-InformationAction <ActionPreference>]
45
45
[-InformationVariable <String>] [<CommonParameters>]
46
46
```
@@ -60,14 +60,22 @@ The first command gets a policy definition named VMPolicyDefinition by using the
60
60
The command stores that object in the $PolicyDefinition variable.
61
61
The second command updates the description of the policy definition identified by the ** ResourceId** property of $PolicyDefinition.
62
62
63
+ ### Example 2: Update the mode of a policy definition
64
+ ```
65
+ PS C:\> Set-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -Mode 'All'
66
+ ```
67
+
68
+ This command updates the policy definition named VMPolicyDefinition by using the Set-AzureRmPolicyDefinition cmdlet to
69
+ set its mode property to 'All'.
70
+
63
71
## PARAMETERS
64
72
65
73
### -ApiVersion
66
74
Specifies the version of the resource provider API to use.
67
75
If you do not specify a version, this cmdlet uses the latest available version.
68
76
69
77
``` yaml
70
- Type : System. String
78
+ Type : String
71
79
Parameter Sets : (All)
72
80
Aliases :
73
81
@@ -82,7 +90,7 @@ Accept wildcard characters: False
82
90
The credentials, account, tenant, and subscription used for communication with azure
83
91
84
92
` ` ` yaml
85
- Type : Microsoft.Azure.Commands.Common.Authentication.Abstractions. IAzureContextContainer
93
+ Type : IAzureContextContainer
86
94
Parameter Sets : (All)
87
95
Aliases : AzureRmContext, AzureCredential
88
96
@@ -97,7 +105,7 @@ Accept wildcard characters: False
97
105
Specifies a new description for the policy definition.
98
106
99
107
` ` ` yaml
100
- Type : System. String
108
+ Type : String
101
109
Parameter Sets : (All)
102
110
Aliases :
103
111
@@ -112,7 +120,7 @@ Accept wildcard characters: False
112
120
Specifies a new display name for the policy definition.
113
121
114
122
` ` ` yaml
115
- Type : System. String
123
+ Type : String
116
124
Parameter Sets : (All)
117
125
Aliases :
118
126
@@ -127,7 +135,7 @@ Accept wildcard characters: False
127
135
Specifies the fully qualified resource ID for the policy definition that this cmdlet modifies.
128
136
129
137
` ` ` yaml
130
- Type : System. String
138
+ Type : String
131
139
Parameter Sets : IdParameterSet
132
140
Aliases : ResourceId
133
141
@@ -149,7 +157,7 @@ The acceptable values for this parameter are:
149
157
- Suspend
150
158
151
159
` ` ` yaml
152
- Type : System.Management.Automation. ActionPreference
160
+ Type : ActionPreference
153
161
Parameter Sets : (All)
154
162
Aliases : infa
155
163
@@ -164,7 +172,7 @@ Accept wildcard characters: False
164
172
Specifies an information variable.
165
173
166
174
` ` ` yaml
167
- Type : System. String
175
+ Type : String
168
176
Parameter Sets : (All)
169
177
Aliases : iv
170
178
@@ -179,7 +187,7 @@ Accept wildcard characters: False
179
187
The name of the management group of the policy definition to update.
180
188
181
189
` ` ` yaml
182
- Type : System. String
190
+ Type : String
183
191
Parameter Sets : ManagementGroupNameParameterSet
184
192
Aliases :
185
193
@@ -194,7 +202,22 @@ Accept wildcard characters: False
194
202
The metadata for policy definition. This can either be a path to a file name containing the metadata, or the metadata as string.
195
203
196
204
` ` ` yaml
197
- Type : System.String
205
+ Type : String
206
+ Parameter Sets : (All)
207
+ Aliases :
208
+
209
+ Required : False
210
+ Position : Named
211
+ Default value : None
212
+ Accept pipeline input : True (ByPropertyName)
213
+ Accept wildcard characters : False
214
+ ` ` `
215
+
216
+ ### -Mode
217
+ The mode of the new policy definition.
218
+
219
+ ` ` ` yaml
220
+ Type : PolicyDefinitionMode
198
221
Parameter Sets : (All)
199
222
Aliases :
200
223
@@ -209,7 +232,7 @@ Accept wildcard characters: False
209
232
Specifies the name of the policy definition that this cmdlet modifies.
210
233
211
234
` ` ` yaml
212
- Type : System. String
235
+ Type : String
213
236
Parameter Sets : NameParameterSet, ManagementGroupNameParameterSet, SubscriptionIdParameterSet
214
237
Aliases :
215
238
@@ -224,7 +247,7 @@ Accept wildcard characters: False
224
247
The parameters declaration for policy definition. This can either be a path to a file name or uri containing the parameters declaration, or the parameters declaration as string.
225
248
226
249
` ` ` yaml
227
- Type : System. String
250
+ Type : String
228
251
Parameter Sets : (All)
229
252
Aliases :
230
253
@@ -240,7 +263,7 @@ Specifies new policy rule for the policy definition.
240
263
You can specify the path of a .json file or a string that contains the policy in JavaScript Object Notation (JSON) format.
241
264
242
265
` ` ` yaml
243
- Type : System. String
266
+ Type : String
244
267
Parameter Sets : (All)
245
268
Aliases :
246
269
@@ -255,7 +278,7 @@ Accept wildcard characters: False
255
278
Indicates that this cmdlet considers pre-release API versions when it automatically determines which version to use.
256
279
257
280
` ` ` yaml
258
- Type : System.Management.Automation. SwitchParameter
281
+ Type : SwitchParameter
259
282
Parameter Sets : (All)
260
283
Aliases :
261
284
@@ -270,7 +293,7 @@ Accept wildcard characters: False
270
293
The subscription ID of the policy definition to update.
271
294
272
295
` ` ` yaml
273
- Type : System.Nullable`1[System. Guid]
296
+ Type : Guid
274
297
Parameter Sets : SubscriptionIdParameterSet
275
298
Aliases :
276
299
0 commit comments