File tree Expand file tree Collapse file tree 6 files changed +19
-10
lines changed
Resources.Test/Formatters Expand file tree Collapse file tree 6 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ public class ChangeTypeComparer : IComparer<ChangeType>
2626 [ ChangeType . Create ] = 1 ,
2727 [ ChangeType . Deploy ] = 2 ,
2828 [ ChangeType . Modify ] = 3 ,
29- [ ChangeType . Ignore ] = 4 ,
30- [ ChangeType . NoChange ] = 5 ,
29+ [ ChangeType . NoChange ] = 4 ,
30+ [ ChangeType . Ignore ] = 5 ,
3131 } ;
3232
3333 public int Compare ( ChangeType first , ChangeType second )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Formatters
1818 using System ;
1919 using System . Collections . Generic ;
2020
21- public class PSResourceManagerErrorFormatter
21+ public static class PSResourceManagerErrorFormatter
2222 {
2323 public static string Format ( PSResourceManagerError error )
2424 {
Original file line number Diff line number Diff line change 3737using Microsoft . Azure . Management . ResourceManager . Models ;
3838using Microsoft . Rest . Azure ;
3939using Microsoft . Rest . Azure . OData ;
40+ using Microsoft . WindowsAzure . Commands . Common ;
4041using Microsoft . WindowsAzure . Commands . Utilities . Common ;
42+ using Newtonsoft . Json ;
4143using Newtonsoft . Json . Linq ;
4244using ProjectResources = Microsoft . Azure . Commands . ResourceManager . Cmdlets . Properties . Resources ;
4345using ProvisioningState = Microsoft . Azure . Commands . ResourceManager . Cmdlets . Entities . ProvisioningState ;
@@ -451,8 +453,10 @@ private Deployment CreateBasicDeployment(PSDeploymentCmdletParameters parameters
451453 }
452454 else
453455 {
454- string parametersContent = parameters . TemplateParameterObject != null
455- ? PSJsonSerializer . Serialize ( parameters . TemplateParameterObject )
456+ // ToDictionary is needed for extracting value from a secure string. Do not remove it.
457+ Dictionary < string , object > parametersDictionary = parameters . TemplateParameterObject ? . ToDictionary ( false ) ;
458+ string parametersContent = parametersDictionary != null
459+ ? PSJsonSerializer . Serialize ( parametersDictionary )
456460 : null ;
457461 deployment . Properties . Parameters = ! string . IsNullOrEmpty ( parametersContent )
458462 ? JObject . Parse ( parametersContent )
Original file line number Diff line number Diff line change 88 using Commands . Common . Authentication . Abstractions ;
99 using Management . ResourceManager . Models ;
1010 using Microsoft . Azure . Commands . ResourceManager . Cmdlets . Json ;
11+ using Microsoft . WindowsAzure . Commands . Common ;
1112 using Newtonsoft . Json . Linq ;
1213
1314 public class PSDeploymentWhatIfCmdletParameters
@@ -105,8 +106,10 @@ public DeploymentWhatIf ToDeploymentWhatIf()
105106 }
106107 else
107108 {
108- string parametersContent = this . TemplateParametersObject != null
109- ? PSJsonSerializer . Serialize ( this . TemplateParametersObject )
109+ // ToDictionary is needed for extracting value from a secure string. Do not remove it.
110+ Dictionary < string , object > parametersDictionary = this . TemplateParametersObject ? . ToDictionary ( false ) ;
111+ string parametersContent = parametersDictionary != null
112+ ? PSJsonSerializer . Serialize ( parametersDictionary )
110113 : null ;
111114 properties . Parameters = ! string . IsNullOrEmpty ( parametersContent )
112115 ? JObject . Parse ( parametersContent )
Original file line number Diff line number Diff line change @@ -273,9 +273,9 @@ public void Format_ResourceIdOnly_SortsAndGroupsByShortResourceId()
273273 - p5/foo
274274 - p6/foo{ Color . Reset } { Color . Green }
275275 + p2/foo{ Color . Reset } { Color . Blue }
276- ! p4/foo{ Color . Reset } { Color . Gray }
277- * p1 /foo{ Color . Reset } { Color . Reset }
278- = p3 /foo
276+ ! p4/foo{ Color . Reset } { Color . Reset }
277+ = p3 /foo{ Color . Reset } { Color . Gray }
278+ * p1 /foo
279279{ Color . Reset }
280280"
281281 . Replace ( "\r \n " , Environment . NewLine ) ;
Original file line number Diff line number Diff line change 1919-->
2020## Upcoming Release
2121* Added breaking change attribute to ` SubscriptionId ` parameter of ` Get-AzResourceGroupDeploymentOperation ` .
22+ * Updated ARM template What-If cmdlets to show "Ignore" resource changes last.
23+ * Fixed an issue where dynamic secure string parameters for deployment cmdlets are not correctly serialized.
2224
2325## Version 2.5.0
2426* Updated ` Get-AzPolicyAlias ` response to include information indicating whether the alias is modifiable by Azure Policy.
You can’t perform that action at this time.
0 commit comments