66using System . Collections . Generic ;
77using System . Collections . Immutable ;
88using System . Collections . ObjectModel ;
9- using System . Diagnostics . CodeAnalysis ;
109using System . Globalization ;
1110using System . IO ;
1211using System . Linq ;
2120using Microsoft . CodeAnalysis . CSharp ;
2221using Microsoft . CodeAnalysis . Emit ;
2322using Microsoft . CodeAnalysis . Text ;
24-
2523using PathType = System . IO . Path ;
2624
2725namespace Microsoft . PowerShell . Commands
2826{
2927 /// <summary>
3028 /// Languages supported for code generation.
3129 /// </summary>
32- [ SuppressMessage ( "Microsoft.Naming" , "CA1724:TypeNamesShouldNotMatchNamespaces" ) ]
3330 public enum Language
3431 {
3532 /// <summary>
@@ -98,7 +95,6 @@ public string TypeDefinition
9895 /// The source code of this generated method / member.
9996 /// </summary>
10097 [ Parameter ( Mandatory = true , Position = 1 , ParameterSetName = FromMemberParameterSetName ) ]
101- [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ) ]
10298 public string [ ] MemberDefinition
10399 {
104100 get
@@ -133,15 +129,13 @@ public string[] MemberDefinition
133129 [ Parameter ( ParameterSetName = FromMemberParameterSetName ) ]
134130 [ ValidateNotNull ( ) ]
135131 [ Alias ( "Using" ) ]
136- [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ) ]
137132 public string [ ] UsingNamespace { get ; set ; } = Array . Empty < string > ( ) ;
138133
139134 /// <summary>
140135 /// The path to the source code or DLL to load.
141136 /// </summary>
142137 [ Parameter ( Mandatory = true , Position = 0 , ParameterSetName = FromPathParameterSetName ) ]
143138 [ ValidateTrustedData ]
144- [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ) ]
145139 public string [ ] Path
146140 {
147141 get
@@ -189,7 +183,6 @@ public string[] Path
189183 [ Parameter ( Mandatory = true , ParameterSetName = FromLiteralPathParameterSetName ) ]
190184 [ Alias ( "PSPath" , "LP" ) ]
191185 [ ValidateTrustedData ]
192- [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ) ]
193186 public string [ ] LiteralPath
194187 {
195188 get
@@ -277,7 +270,6 @@ private void ProcessPaths(List<string> resolvedPaths)
277270 [ Parameter ( Mandatory = true , ParameterSetName = FromAssemblyNameParameterSetName ) ]
278271 [ Alias ( "AN" ) ]
279272 [ ValidateTrustedData ]
280- [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ) ]
281273 public string [ ] AssemblyName { get ; set ; }
282274
283275 private bool _loadAssembly = false ;
@@ -298,7 +290,6 @@ private void ProcessPaths(List<string> resolvedPaths)
298290 [ Parameter ( ParameterSetName = FromPathParameterSetName ) ]
299291 [ Parameter ( ParameterSetName = FromLiteralPathParameterSetName ) ]
300292 [ Alias ( "RA" ) ]
301- [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ) ]
302293 public string [ ] ReferencedAssemblies
303294 {
304295 get { return _referencedAssemblies ; }
@@ -813,7 +804,6 @@ private string ResolveAssemblyName(string assembly, bool isForReferenceAssembly)
813804 // However, this does give us a massive usability improvement, as users can just say
814805 // Add-Type -AssemblyName Forms (instead of System.Windows.Forms)
815806 // This is just long, not unmaintainable.
816- [ SuppressMessage ( "Microsoft.Maintainability" , "CA1505:AvoidUnmaintainableCode" ) ]
817807 private Assembly LoadAssemblyHelper ( string assemblyName )
818808 {
819809 Assembly loadedAssembly = null ;
0 commit comments