@@ -140,7 +140,7 @@ internal virtual void Add(PSObject groupValue)
140140
141141 private static string BuildName ( List < ObjectCommandPropertyValue > propValues )
142142 {
143- StringBuilder sb = new StringBuilder ( ) ;
143+ StringBuilder sb = new ( ) ;
144144 foreach ( ObjectCommandPropertyValue propValue in propValues )
145145 {
146146 var propValuePropertyValue = propValue ? . PropertyValue ;
@@ -176,7 +176,7 @@ public ArrayList Values
176176 {
177177 get
178178 {
179- ArrayList values = new ArrayList ( ) ;
179+ ArrayList values = new ( ) ;
180180 foreach ( ObjectCommandPropertyValue propValue in GroupValue . orderValues )
181181 {
182182 values . Add ( propValue . PropertyValue ) ;
@@ -248,10 +248,10 @@ public class GroupObjectCommand : ObjectBase
248248 [ Parameter ( ParameterSetName = "HashTable" ) ]
249249 public SwitchParameter AsString { get ; set ; }
250250
251- private readonly List < GroupInfo > _groups = new List < GroupInfo > ( ) ;
252- private readonly OrderByProperty _orderByProperty = new OrderByProperty ( ) ;
253- private readonly Dictionary < object , GroupInfo > _tupleToGroupInfoMappingDictionary = new Dictionary < object , GroupInfo > ( ) ;
254- private readonly List < OrderByPropertyEntry > _entriesToOrder = new List < OrderByPropertyEntry > ( ) ;
251+ private readonly List < GroupInfo > _groups = new ( ) ;
252+ private readonly OrderByProperty _orderByProperty = new ( ) ;
253+ private readonly Dictionary < object , GroupInfo > _tupleToGroupInfoMappingDictionary = new ( ) ;
254+ private readonly List < OrderByPropertyEntry > _entriesToOrder = new ( ) ;
255255 private OrderByPropertyComparer _orderByPropertyComparer ;
256256 private bool _hasProcessedFirstInputObject ;
257257 private bool _hasDifferentValueTypes ;
@@ -375,7 +375,7 @@ private static void DoOrderedGrouping(
375375
376376 private void WriteNonTerminatingError ( Exception exception , string resourceIdAndErrorId , ErrorCategory category )
377377 {
378- Exception ex = new Exception ( StringUtil . Format ( resourceIdAndErrorId ) , exception ) ;
378+ Exception ex = new ( StringUtil . Format ( resourceIdAndErrorId ) , exception ) ;
379379 WriteError ( new ErrorRecord ( ex , resourceIdAndErrorId , category , null ) ) ;
380380 }
381381
@@ -401,15 +401,15 @@ protected override void ProcessRecord()
401401
402402 if ( AsString && ! AsHashTable )
403403 {
404- ArgumentException ex = new ArgumentException ( UtilityCommonStrings . GroupObjectWithHashTable ) ;
405- ErrorRecord er = new ErrorRecord ( ex , "ArgumentException" , ErrorCategory . InvalidArgument , AsString ) ;
404+ ArgumentException ex = new ( UtilityCommonStrings . GroupObjectWithHashTable ) ;
405+ ErrorRecord er = new ( ex , "ArgumentException" , ErrorCategory . InvalidArgument , AsString ) ;
406406 ThrowTerminatingError ( er ) ;
407407 }
408408
409409 if ( AsHashTable && ! AsString && ( Property != null && ( Property . Length > 1 || _orderByProperty . MshParameterList . Count > 1 ) ) )
410410 {
411- ArgumentException ex = new ArgumentException ( UtilityCommonStrings . GroupObjectSingleProperty ) ;
412- ErrorRecord er = new ErrorRecord ( ex , "ArgumentException" , ErrorCategory . InvalidArgument , Property ) ;
411+ ArgumentException ex = new ( UtilityCommonStrings . GroupObjectSingleProperty ) ;
412+ ErrorRecord er = new ( ex , "ArgumentException" , ErrorCategory . InvalidArgument , Property ) ;
413413 ThrowTerminatingError ( er ) ;
414414 }
415415
0 commit comments