8000 Remove redundant `Attribute` suffix (#24940) · PowerShell/PowerShell@1790f3a · GitHub
[go: up one dir, main page]

Skip to content

Commit 1790f3a

Browse files
authored
Remove redundant Attribute suffix (#24940)
1 parent 8f1d111 commit 1790f3a

File tree

58 files changed

+300
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+300
-300
lines changed

src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private void NewSubscriptionResultHandler(object src, CimSubscriptionEventArgs a
239239
/// If set EnableRaisingEvents to false, which will be ignored
240240
/// </para>
241241
/// </summary>
242-
[BrowsableAttribute(false)]
242+
[Browsable(false)]
243243
public bool EnableRaisingEvents
244244
{
245245
get

src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public abstract class CoreCommandBase : PSCmdlet, IDynamicParameters
2525
/// An instance of the PSTraceSource class used for trace output
2626
/// using "NavigationCommands" as the category.
2727
/// </summary>
28-
[Dbg.TraceSourceAttribute("NavigationCommands", "The namespace navigation tracer")]
28+
[Dbg.TraceSource("NavigationCommands", "The namespace navigation tracer")]
2929
internal static readonly Dbg.PSTraceSource tracer = Dbg.PSTraceSource.GetTracer("NavigationCommands", "The namespace navigation tracer");
3030

3131
#endregion Tracer

src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public SwitchParameter PassThru
147147
/// The name of the new NoteProperty member.
148148
/// </summary>
149149
[Parameter(Mandatory = true, Position = 0, ParameterSetName = NotePropertySingleMemberSet)]
150-
[ValidateNotePropertyNameAttribute]
151-
[NotePropertyTransformationAttribute]
150+
[ValidateNotePropertyName]
151+
[NotePropertyTransformation]
152152
[ValidateNotNullOrEmpty]
153153
public string NotePropertyName
154154
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ public string LiteralPath
218218
/// Gets or sets encoding optional flag.
219219
/// </summary>
220220
[Parameter]
221-
[ArgumentToEncodingTransformationAttribute]
222-
[ArgumentEncodingCompletionsAttribute]
221+
[ArgumentToEncodingTransformation]
222+
[ArgumentEncodingCompletions]
223223
[ValidateNotNullOrEmpty]
224224
public Encoding Encoding
225225
{
@@ -602,8 +602,8 @@ public string[] LiteralPath
602602
/// Gets or sets encoding optional flag.
603603
/// </summary>
604604
[Parameter]
605-
[ArgumentToEncodingTransformationAttribute]
606-
[ArgumentEncodingCompletionsAttribute]
605+
[ArgumentToEncodingTransformation]
606+
[ArgumentEncodingCompletions]
607607
[ValidateNotNullOrEmpty]
608608
public Encoding Encoding
609609
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public sealed class FormatHex : PSCmdlet
6868
/// Gets or sets the type of character encoding for InputObject.
6969
/// </summary>
7070
[Parameter(ParameterSetName = "ByInputObject")]
71-
[ArgumentToEncodingTransformationAttribute]
72-
[ArgumentEncodingCompletionsAttribute]
71+
[ArgumentToEncodingTransformation]
72+
[ArgumentEncodingCompletions]
7373
[ValidateNotNullOrEmpty]
7474
public Encoding Encoding
7575
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-object/Format-Object.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public object[] Property
4444
/// <summary>
4545
/// </summary>
4646
/// <value></value>
47-
[ValidateRangeAttribute(1, int.MaxValue)]
47+
[ValidateRange(1, int.MaxValue)]
4848
[Parameter]
4949
public int Depth
5050
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-wide/Format-Wide.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public SwitchParameter AutoSize
5959
/// </summary>
6060
/// <value></value>
6161
[Parameter]
62-
[ValidateRangeAttribute(1, int.MaxValue)]
62+
[ValidateRange(1, int.MaxValue)]
6363
public int Column
6464
{
6565
get => _column.GetValueOrDefault(-1);

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public string LiteralPath
7474
/// Encoding optional flag.
7575
/// </summary>
7676
[Parameter(Position = 1)]
77-
[ArgumentToEncodingTransformationAttribute]
78-
[ArgumentEncodingCompletionsAttribute]
77+
[ArgumentToEncodingTransformation]
78+
[ArgumentEncodingCompletions]
7979
[ValidateNotNullOrEmpty]
8080
public Encoding Encoding
8181
{
@@ -136,7 +136,7 @@ public SwitchParameter NoClobber
136136
/// <summary>
137137
/// Optional, number of columns to use when writing to device.
138138
/// </summary>
139-
[ValidateRangeAttribute(2, int.MaxValue)]
139+
[ValidateRange(2, int.MaxValue)]
140140
[Parameter]
141141
public int Width
142142
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/Out-String.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public SwitchParameter Stream
3434
/// <summary>
3535
/// Optional, number of columns to use when writing to device.
3636
/// </summary>
37-
[ValidateRangeAttribute(2, int.MaxValue)]
37+
[ValidateRange(2, int.MaxValue)]
3838
[Parameter]
3939
public int Width
4040
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public long UnixTimeSeconds
7878
/// Allows the user to override the year.
7979
/// </summary>
8080
[Parameter]
81-
[ValidateRangeAttribute(1, 9999)]
81+
[ValidateRange(1, 9999)]
8282
public int Year
8383
{
8484
get
@@ -100,7 +100,7 @@ public int Year
100100
/// Allows the user to override the month.
101101
/// </summary>
102102
[Parameter]
103-
[ValidateRangeAttribute(1, 12)]
103+
[ValidateRange(1, 12)]
104104
public int Month
105105
{
106106
get
@@ -122,7 +122,7 @@ public int Month
122122
/// Allows the user to override the day.
123123
/// </summary>
124124
[Parameter]
125-
[ValidateRangeAttribute(1, 31)]
125+
[ValidateRange(1, 31)]
126126
public int Day
127127
{
128128
get
@@ -144,7 +144,7 @@ public int Day
144144
/// Allows the user to override the hour.
145145
/// </summary>
146146
[Parameter]
147-
[ValidateRangeAttribute(0, 23)]
147+
[ValidateRange(0, 23)]
148148
public int Hour
149149
{
150150
get
@@ -166,7 +166,7 @@ public int Hour
166166
/// Allows the user to override the minute.
167167
/// </summary>
168168
[Parameter]
169-
[ValidateRangeAttribute(0, 59)]
169+
[ValidateRange(0, 59)]
170170
public int Minute
171171
{
172172
get
@@ -188,7 +188,7 @@ public int Minute
188188
/// Allows the user to override the second.
189189
/// </summary>
190190
[Parameter]
191-
[ValidateRangeAttribute(0, 59)]
191+
[ValidateRange(0, 59)]
192192
public int Second
193193
{
194194
get
@@ -210,7 +210,7 @@ public int Second
210210
/// Allows the user to override the millisecond.
211211
/// </summary>
212212
[Parameter]
213-
[ValidateRangeAttribute(0, 999)]
213+
[ValidateRange(0, 999)]
214214
public int Millisecond
215215
{
216216
get

src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public SwitchParameter Force
7373
/// Encoding optional flag.
7474
/// </summary>
7575
[Parameter]
76-
[ArgumentToEncodingTransformationAttribute]
77-
[ArgumentEncodingCompletionsAttribute]
76+
[ArgumentToEncodingTransformation]
77+
[ArgumentEncodingCompletions]
7878
[ValidateNotNullOrEmpty]
7979
public Encoding Encoding
8080
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,8 +1336,8 @@ public string[] Exclude
13361336
/// Gets or sets the text encoding to process each file as.
13371337
/// </summary>
13381338
[Parameter]
1339-
[ArgumentToEncodingTransformationAttribute]
1340-
[ArgumentEncodingCompletionsAttribute]
1339+
[ArgumentToEncodingTransformation]
1340+
[ArgumentEncodingCompletions]
13411341
[ValidateNotNullOrEmpty]
13421342
public Encoding Encoding
13431343
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public int First
179179
/// </summary>
180180
/// <value></value>
181181
[Parameter(ParameterSetName = "IndexParameter")]
182-
[ValidateRangeAttribute(0, int.MaxValue)]
182+
[ValidateRange(0, int.MaxValue)]
183183
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
184184
public int[] Index
185185
{
@@ -202,7 +202,7 @@ public int[] Index
202202
/// </summary>
203203
/// <value></value>
204204
[Parameter(ParameterSetName = "SkipIndexParameter")]
205-
[ValidateRangeAttribute(0, int.MaxValue)]
205+
[ValidateRange(0, int.MaxValue)]
206206
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
207207
public int[] SkipIndex
208208
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public sealed class SendMailMessage : PSCmdlet
6161
[Parameter(ValueFromPipelineByPropertyName = true)]
6262
[Alias("BE")]
6363
[ValidateNotNullOrEmpty]
64-
[ArgumentEncodingCompletionsAttribute]
65-
[ArgumentToEncodingTransformationAttribute]
64+
[ArgumentEncodingCompletions]
65+
[ArgumentToEncodingTransformation]
6666
public Encoding Encoding
6767
{
6868
get

src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ public void Dispose()
4444
/// </summary>
4545
[Parameter(Position = 0, Mandatory = true, ParameterSetName = "Seconds", ValueFromPipeline = true,
4646
ValueFromPipelineByPropertyName = true)]
47-
[ValidateRangeAttribute(0.0, (double)(int.MaxValue / 1000))]
47+
[ValidateRange(0.0, (double)(int.MaxValue / 1000))]
4848
public double Seconds { get; set; }
4949

5050
/// <summary>
5151
/// Allows sleep time to be specified in milliseconds.
5252
/// </summary>
5353
[Parameter(Mandatory = true, ParameterSetName = "Milliseconds", ValueFromPipelineByPropertyName = true)]
54-
[ValidateRangeAttribute(0, int.MaxValue)]
54+
[ValidateRange(0, int.MaxValue)]
5555
[Alias("ms")]
5656
public int Milliseconds { get; set; }
5757

src/Microsoft.PowerShell.Commands.Utility/commands/utility/Tee-Object.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public SwitchParameter Append
7878
/// </summary>
7979
[Parameter(ParameterSetName = "File")]
8080
[Parameter(ParameterSetName = "LiteralFile")]
81-
[ArgumentToEncodingTransformationAttribute]
82-
[ArgumentEncodingCompletionsAttribute]
81+
[ArgumentToEncodingTransformation]
82+
[ArgumentEncodingCompletions]
8383
[ValidateNotNullOrEmpty]
8484
public Encoding Encoding { get; set; } = Encoding.Default;
8585

src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public string[] PropertySerializationSet
260260
/// The type name we want to update on.
261261
/// </summary>
262262
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = DynamicTypeSet)]
263-
[ArgumentToTypeNameTransformationAttribute]
263+
[ArgumentToTypeNameTransformation]
264264
[ValidateNotNullOrEmpty]
265265
public string TypeName
266266
{
@@ -1051,7 +1051,7 @@ public class RemoveTypeDataCommand : PSCmdlet
10511051
/// The target type to remove.
10521052
/// </summary>
10531053
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveTypeSet)]
1054-
[ArgumentToTypeNameTransformationAttribute]
1054+
[ArgumentToTypeNameTransformation]
10551055
[ValidateNotNullOrEmpty]
10561056
public string TypeName
10571057
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public string SourceIdentifier
4242
/// </summary>
4343
[Parameter]
4444
[Alias("TimeoutSec")]
45-
[ValidateRangeAttribute(-1, int.MaxValue)]
45+
[ValidateRange(-1, int.MaxValue)]
4646
public int Timeout
4747
{
4848
get

src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs

Lines changed: 2 additions & 2 deletions
< 10000 /div>
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public SwitchParameter NoClobber
111111
/// Encoding optional flag.
112112
/// </summary>
113113
[Parameter]
114-
[ArgumentToEncodingTransformationAttribute()]
115-
[ArgumentEncodingCompletionsAttribute]
114+
[ArgumentToEncodingTransformation]
115+
[ArgumentEncodingCompletions]
116116
[ValidateNotNullOrEmpty]
117117
public Encoding Encoding
118118
{

src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2250,7 +2250,7 @@ internal void HandleThrowOnReadAndPrompt()
22502250
private readonly ConsoleHostRawUserInterface _rawui;
22512251
private readonly ConsoleHost _parent;
22522252

2253-
[TraceSourceAttribute("ConsoleHostUserInterface", "Console host's subclass of S.M.A.Host.Console")]
2253+
[TraceSource("ConsoleHostUserInterface", "Console host's subclass of S.M.A.Host.Console")]
22542254
private static readonly PSTraceSource s_tracer = PSTraceSource.GetTracer("ConsoleHostUserInterface", "Console host's subclass of S.M.A.Host.Console");
22552255
}
22562256
} // namespace

src/Microsoft.WSMan.Management/Interop.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public enum AuthenticationMechanism
173173
[ComImport]
174174
[TypeLibType((short)4304)]
175175
#if CORECLR
176-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
176+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
177177
#else
178178
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
179179
#endif
@@ -255,7 +255,7 @@ string Error
255255
[ComImport]
256256
[TypeLibType((short)4288)]
257257
#if CORECLR
258-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
258+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
259259
#else
260260
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
261261
#endif
@@ -312,7 +312,7 @@ string Password
312312
[ComImport]
313313
[TypeLibType((short)4288)]
314314
#if CORECLR
315-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
315+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
316316
#else
317317
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
318318
#endif
@@ -336,7 +336,7 @@ string CertificateThumbprint
336336
[ComImport]
337337
[TypeLibType((short)4288)]
338338
#if CORECLR
339-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
339+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
340340
#else
341341
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
342342
#endif
@@ -386,7 +386,7 @@ void SetProxy(int accessType,
386386
[ComImport]
387387
[TypeLibType((short)4288)]
388388
#if CORECLR
389-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
389+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
390390
#else
391391
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
392392
#endif
@@ -450,7 +450,7 @@ string Error
450450
[TypeLibType((short)4304)]
451451
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
452452
#if CORECLR
453-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
453+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
454454
#else
455455
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
456456
#endif
@@ -706,7 +706,7 @@ string Error
706706
[ComImport]
707707
[TypeLibType((short)4288)]
708708
#if CORECLR
709-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
709+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
710710
#else
711711
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
712712
#endif
@@ -860,7 +860,7 @@ string Error
860860
[ComImport]
861861
[TypeLibType((short)4288)]
862862
#if CORECLR
863-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
863+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
864864
#else
865865
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
866866
#endif
@@ -1005,7 +1005,7 @@ int Timeout
10051005
[ComImport]
10061006
[TypeLibType((short)400)]
10071007
#if CORECLR
1008-
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
1008+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
10091009
#else
10101010
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
10111011
#endif

src/Microsoft.WSMan.Management/WSManInstance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public Uri ResourceURI
326326
[Parameter(ParameterSetName = "Enumerate")]
327327

328328
[ValidateNotNullOrEmpty]
329-
[ValidateSetAttribute(new string[] { "object", "epr", "objectandepr" })]
329+
[ValidateSet(new string[] { "object", "epr", "objectandepr" })]
330330
[Alias("RT")]
331331
public string ReturnType
332332
{

src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.PowerShell.Commands
1414
/// <summary>
1515
/// Null sink to absorb pipeline output.
1616
/// </summary>
17-
[CmdletAttribute("Out", "Null", SupportsShouldProcess = false,
17+
[Cmdlet("Out", "Null", SupportsShouldProcess = false,
1818
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2096792", RemotingCapability = RemotingCapability.None)]
1919
public class OutNullCommand : PSCmdlet
2020
{

0 commit comments

Comments
 (0)
0