@@ -544,19 +544,19 @@ public static class DscClassCache
544544
545545 // Create a list of classes which are not actual DSC resources similar to what we do inside PSDesiredStateConfiguration.psm1
546546 private static readonly string [ ] s_hiddenResourceList =
547- {
548- "MSFT_BaseConfigurationProviderRegistration" ,
549- "MSFT_CimConfigurationProviderRegistration" ,
550- "MSFT_PSConfigurationProviderRegistration" ,
551- } ;
547+ {
548+ "MSFT_BaseConfigurationProviderRegistration" ,
549+ "MSFT_CimConfigurationProviderRegistration" ,
550+ "MSFT_PSConfigurationProviderRegistration" ,
551+ } ;
552552
553553 // Create a HashSet for fast lookup. According to MSDN, the time complexity of search for an element in a HashSet is O(1)
554- private static readonly HashSet < string > s_hiddenResourceCache = new HashSet < string > ( s_hiddenResourceList ,
555- StringComparer . OrdinalIgnoreCase ) ;
554+ private static readonly HashSet < string > s_hiddenResourceCache =
555+ new ( s_hiddenResourceList , StringComparer . OrdinalIgnoreCase ) ;
556556
557557 // a collection to hold current importing script based resource file
558558 // this prevent circular importing case when the script resource existing in the same module with resources it import-dscresource
559- private static readonly HashSet < string > s_currentImportingScriptFiles = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
559+ private static readonly HashSet < string > s_currentImportingScriptFiles = new ( StringComparer . OrdinalIgnoreCase ) ;
560560
561561 /// <summary>
562562 /// DSC class cache for this runspace.
@@ -638,18 +638,20 @@ private static HashSet<string> ScriptKeywordFileCache
638638 /// <summary>
639639 /// Default ModuleName and ModuleVersion to use.
640640 /// </summary>
641- private static readonly Tuple < string , Version > s_defaultModuleInfoForResource = new Tuple < string , Version > ( "PSDesiredStateConfiguration" , new Version ( "1.1" ) ) ;
641+ private static readonly Tuple < string , Version > s_defaultModuleInfoForResource =
642+ new ( "PSDesiredStateConfiguration" , new Version ( "1.1" ) ) ;
642643
643644 /// <summary>
644645 /// Default ModuleName and ModuleVersion to use for meta configuration resources.
645646 /// </summary>
646- internal static readonly Tuple < string , Version > DefaultModuleInfoForMetaConfigResource = new Tuple < string , Version > ( "PSDesiredStateConfigurationEngine" , new Version ( "2.0" ) ) ;
647+ internal static readonly Tuple < string , Version > DefaultModuleInfoForMetaConfigResource =
648+ new ( "PSDesiredStateConfigurationEngine" , new Version ( "2.0" ) ) ;
647649
648650 /// <summary>
649651 /// A set of dynamic keywords that can be used in both configuration and meta configuration.
650652 /// </summary>
651653 internal static readonly HashSet < string > SystemResourceNames =
652- new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) { "Node" , "OMI_ConfigurationDocument" } ;
654+ new ( StringComparer . OrdinalIgnoreCase ) { "Node" , "OMI_ConfigurationDocument" } ;
653655
654656 /// <summary>
655657 /// When this property is set to true, DSC Cache will cache multiple versions of a resource.
@@ -784,7 +786,7 @@ public static void Initialize(Collection<Exception> errors, List<string> moduleP
784786
785787 // Load Regular and DSC PS modules
786788 bool importInBoxResourcesImplicitly = false ;
787- List < string > modulePaths = new List < string > ( ) ;
789+ List < string > modulePaths = new ( ) ;
788790 if ( modulePathList == null || modulePathList . Count == 0 )
789791 {
790792 modulePaths . Add ( Path . Combine ( configSystemPath , inboxModulePath ) ) ;
@@ -1131,7 +1133,7 @@ private static List<DscClassCacheEntry> GetCachedClasses()
11311133 /// <returns>List of cached cim classes.</returns>
11321134 public static List < Microsoft . Management . Infrastructure . CimClass > GetCachedClassesForModule ( PSModuleInfo module )
11331135 {
1134- List < Microsoft . Management . Infrastructure . CimClass > cachedClasses = new List < Microsoft . Management . Infrastructure . CimClass > ( ) ;
1136+ List < Microsoft . Management . Infrastructure . CimClass > cachedClasses = new ( ) ;
11351137 var moduleQualifiedName = string . Format ( CultureInfo . InvariantCulture , "{0}\\ {1}" , module . Name , module . Version . ToString ( ) ) ;
11361138 foreach ( var dscClassCacheEntry in ClassCache )
11371139 {
@@ -1151,7 +1153,7 @@ private static List<DscClassCacheEntry> GetCachedClasses()
11511153 /// <returns></returns>
11521154 public static List < string > GetFileDefiningClass ( string className )
11531155 {
1154- List < string > files = new List < string > ( ) ;
1156+ List < string > files = new ( ) ;
11551157 foreach ( var pair in ByFileClassCache )
11561158 {
11571159 var file = pair . Key ;
@@ -1298,7 +1300,7 @@ private static string GetFriendlyName(CimClass cimClass)
12981300 /// </summary>
12991301 public static Collection < DynamicKeyword > GetCachedKeywords ( )
13001302 {
1301- Collection < DynamicKeyword > keywords = new Collection < DynamicKeyword > ( ) ;
1303+ Collection < DynamicKeyword > keywords = new ( ) ;
13021304
13031305 foreach ( KeyValuePair < string , DscClassCacheEntry > cachedClass in ClassCache )
13041306 {
@@ -1909,7 +1911,7 @@ private static ParseError[] ImportResourceCheckSemantics(DynamicKeywordStatement
19091911 // This function performs semantic checks for all DSC Resources keywords.
19101912 private static ParseError [ ] CheckMandatoryPropertiesPresent ( DynamicKeywordStatementAst kwAst )
19111913 {
1912- HashSet < string > mandatoryPropertiesNames = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
1914+ HashSet < string > mandatoryPropertiesNames = new ( StringComparer . OrdinalIgnoreCase ) ;
19131915 foreach ( var pair in kwAst . Keyword . Properties )
19141916 {
19151917 if ( pair . Value . Mandatory )
@@ -2361,7 +2363,7 @@ private static void GenerateMofForAst(TypeDefinitionAst typeAst, StringBuilder s
23612363
23622364 ProcessMembers ( sb , embeddedInstanceTypes , typeAst , className ) ;
23632365
2364- Queue < object > bases = new Queue < object > ( ) ;
2366+ Queue < object > bases = new ( ) ;
23652367 foreach ( var b in typeAst . BaseTypes )
23662368 {
23672369 bases . Enqueue ( b ) ;
@@ -2459,7 +2461,7 @@ public static bool GetResourceMethodsLinePosition(PSModuleInfo moduleInfo, strin
24592461 }
24602462
24612463 IEnumerable < Ast > resourceDefinitions ;
2462- List < string > moduleFiles = new List < string > ( ) ;
2464+ List < string > moduleFiles = new ( ) ;
24632465 if ( moduleInfo . RootModule != null )
24642466 {
24652467 moduleFiles . Add ( moduleInfo . Path ) ;
@@ -2593,7 +2595,7 @@ private static bool GetResourceDefinitionsFromModule(string fileName, out IEnume
25932595 {
25942596 if ( errorList != null && extent != null )
25952597 {
2596- List < string > errorMessages = new List < string > ( ) ;
2598+ List < string > errorMessages = new ( ) ;
25972599 foreach ( var error in errors )
25982600 {
25992601 errorMessages . Add ( error . ToString ( ) ) ;
@@ -2698,7 +2700,7 @@ private static bool ImportKeywordsFromScriptFile(string fileName, PSModuleInfo m
26982700 return result ;
26992701 }
27002702
2701- private static readonly Dictionary < Type , string > s_mapPrimitiveDotNetTypeToMof = new Dictionary < Type , string > ( )
2703+ private static readonly Dictionary < Type , string > s_mapPrimitiveDotNetTypeToMof = new ( )
27022704 {
27032705 { typeof ( sbyte ) , "sint8" } ,
27042706 { typeof ( byte ) , "uint8" } ,
@@ -2946,7 +2948,7 @@ private static string MapAttributesToMof(string[] enumNames, IEnumerable<object>
29462948 if ( validateSet != null )
29472949 {
29482950 bool valueMapComma = false ;
2949- StringBuilder sbValues = new StringBuilder ( ", Values{" ) ;
2951+ StringBuilder sbValues = new ( ", Values{" ) ;
29502952 sb . AppendFormat ( CultureInfo . InvariantCulture , "{0}ValueMap{{" , needComma ? ", " : string . Empty ) ;
29512953 needComma = true ;
29522954
@@ -3662,7 +3664,7 @@ public static string GetDSCResourceUsageString(DynamicKeyword keyword)
36623664 private static StringBuilder FormatCimPropertyType ( DynamicKeywordProperty prop , bool isOptionalProperty )
36633665 {
36643666 string cimTypeName = prop . TypeConstraint ;
3665- StringBuilder formattedTypeString = new StringBuilder ( ) ;
3667+ StringBuilder formattedTypeString = new ( ) ;
36663668
36673669 if ( string . Equals ( cimTypeName , "MSFT_Credential" , StringComparison . OrdinalIgnoreCase ) )
36683670 {
0 commit comments