Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private void NewSubscriptionResultHandler(object src, CimSubscriptionEventArgs a
/// If set EnableRaisingEvents to false, which will be ignored
/// </para>
/// </summary>
[BrowsableAttribute(false)]
[Browsable(false)]
public bool EnableRaisingEvents
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class CoreCommandBase : PSCmdlet, IDynamicParameters
/// An instance of the PSTraceSource class used for trace output
/// using "NavigationCommands" as the category.
/// </summary>
[Dbg.TraceSourceAttribute("NavigationCommands", "The namespace navigation tracer")]
[Dbg.TraceSource("NavigationCommands", "The namespace navigation tracer")]
internal static readonly Dbg.PSTraceSource tracer = Dbg.PSTraceSource.GetTracer("NavigationCommands", "The namespace navigation tracer");

#endregion Tracer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public SwitchParameter PassThru
/// The name of the new NoteProperty member.
/// </summary>
[Parameter(Mandatory = true, Position = 0, ParameterSetName = NotePropertySingleMemberSet)]
[ValidateNotePropertyNameAttribute]
[NotePropertyTransformationAttribute]
[ValidateNotePropertyName]
[NotePropertyTransformation]
[ValidateNotNullOrEmpty]
public string NotePropertyName
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ public string LiteralPath
/// Gets or sets encoding optional flag.
/// </summary>
[Parameter]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down Expand Up @@ -602,8 +602,8 @@ public string[] LiteralPath
/// Gets or sets encoding optional flag.
/// </summary>
[Parameter]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public sealed class FormatHex : PSCmdlet
/// Gets or sets the type of character encoding for InputObject.
/// </summary>
[Parameter(ParameterSetName = "ByInputObject")]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public object[] Property
/// <summary>
/// </summary>
/// <value></value>
[ValidateRangeAttribute(1, int.MaxValue)]
[ValidateRange(1, int.MaxValue)]
[Parameter]
public int Depth
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public SwitchParameter AutoSize
/// </summary>
/// <value></value>
[Parameter]
[ValidateRangeAttribute(1, int.MaxValue)]
[ValidateRange(1, int.MaxValue)]
public int Column
{
get => _column.GetValueOrDefault(-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public string LiteralPath
/// Encoding optional flag.
/// </summary>
[Parameter(Position = 1)]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down Expand Up @@ -136,7 +136,7 @@ public SwitchParameter NoClobber
/// <summary>
/// Optional, number of columns to use when writing to device.
/// </summary>
[ValidateRangeAttribute(2, int.MaxValue)]
[ValidateRange(2, int.MaxValue)]
[Parameter]
public int Width
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public SwitchParameter Stream
/// <summary>
/// Optional, number of columns to use when writing to device.
/// </summary>
[ValidateRangeAttribute(2, int.MaxValue)]
[ValidateRange(2, int.MaxValue)]
[Parameter]
public int Width
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public long UnixTimeSeconds
/// Allows the user to override the year.
/// </summary>
[Parameter]
[ValidateRangeAttribute(1, 9999)]
[ValidateRange(1, 9999)]
public int Year
{
get
Expand All @@ -100,7 +100,7 @@ public int Year
/// Allows the user to override the month.
/// </summary>
[Parameter]
[ValidateRangeAttribute(1, 12)]
[ValidateRange(1, 12)]
public int Month
{
get
Expand All @@ -122,7 +122,7 @@ public int Month
/// Allows the user to override the day.
/// </summary>
[Parameter]
[ValidateRangeAttribute(1, 31)]
[ValidateRange(1, 31)]
public int Day
{
get
Expand All @@ -144,7 +144,7 @@ public int Day
/// Allows the user to override the hour.
/// </summary>
[Parameter]
[ValidateRangeAttribute(0, 23)]
[ValidateRange(0, 23)]
public int Hour
{
get
Expand All @@ -166,7 +166,7 @@ public int Hour
/// Allows the user to override the minute.
/// </summary>
[Parameter]
[ValidateRangeAttribute(0, 59)]
[ValidateRange(0, 59)]
public int Minute
{
get
Expand All @@ -188,7 +188,7 @@ public int Minute
/// Allows the user to override the second.
/// </summary>
[Parameter]
[ValidateRangeAttribute(0, 59)]
[ValidateRange(0, 59)]
public int Second
{
get
Expand All @@ -210,7 +210,7 @@ public int Second
/// Allows the user to override the millisecond.
/// </summary>
[Parameter]
[ValidateRangeAttribute(0, 999)]
[ValidateRange(0, 999)]
public int Millisecond
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public SwitchParameter Force
/// Encoding optional flag.
/// </summary>
[Parameter]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,8 @@ public string[] Exclude
/// Gets or sets the text encoding to process each file as.
/// </summary>
[Parameter]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public int First
/// </summary>
/// <value></value>
[Parameter(ParameterSetName = "IndexParameter")]
[ValidateRangeAttribute(0, int.MaxValue)]
[ValidateRange(0, int.MaxValue)]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public int[] Index
{
Expand All @@ -202,7 +202,7 @@ public int[] Index
/// </summary>
/// <value></value>
[Parameter(ParameterSetName = "SkipIndexParameter")]
[ValidateRangeAttribute(0, int.MaxValue)]
[ValidateRange(0, int.MaxValue)]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public int[] SkipIndex
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public sealed class SendMailMessage : PSCmdlet
[Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("BE")]
[ValidateNotNullOrEmpty]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletions]
[ArgumentToEncodingTransformation]
public Encoding Encoding
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public void Dispose()
/// </summary>
[Parameter(Position = 0, Mandatory = true, ParameterSetName = "Seconds", ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateRangeAttribute(0.0, (double)(int.MaxValue / 1000))]
[ValidateRange(0.0, (double)(int.MaxValue / 1000))]
public double Seconds { get; set; }

/// <summary>
/// Allows sleep time to be specified in milliseconds.
/// </summary>
[Parameter(Mandatory = true, ParameterSetName = "Milliseconds", ValueFromPipelineByPropertyName = true)]
[ValidateRangeAttribute(0, int.MaxValue)]
[ValidateRange(0, int.MaxValue)]
[Alias("ms")]
public int Milliseconds { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public SwitchParameter Append
/// </summary>
[Parameter(ParameterSetName = "File")]
[Parameter(ParameterSetName = "LiteralFile")]
[ArgumentToEncodingTransformationAttribute]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding { get; set; } = Encoding.Default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public string[] PropertySerializationSet
/// The type name we want to update on.
/// </summary>
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = DynamicTypeSet)]
[ArgumentToTypeNameTransformationAttribute]
[ArgumentToTypeNameTransformation]
[ValidateNotNullOrEmpty]
public string TypeName
{
Expand Down Expand Up @@ -1051,7 +1051,7 @@ public class RemoveTypeDataCommand : PSCmdlet
/// The target type to remove.
/// </summary>
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveTypeSet)]
[ArgumentToTypeNameTransformationAttribute]
[ArgumentToTypeNameTransformation]
[ValidateNotNullOrEmpty]
public string TypeName
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public string SourceIdentifier
/// </summary>
[Parameter]
[Alias("TimeoutSec")]
[ValidateRangeAttribute(-1, int.MaxValue)]
[ValidateRange(-1, int.MaxValue)]
public int Timeout
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public SwitchParameter NoClobber
/// Encoding optional flag.
/// </summary>
[Parameter]
[ArgumentToEncodingTransformationAttribute()]
[ArgumentEncodingCompletionsAttribute]
[ArgumentToEncodingTransformation]
[ArgumentEncodingCompletions]
[ValidateNotNullOrEmpty]
public Encoding Encoding
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ internal void HandleThrowOnReadAndPrompt()
private readonly ConsoleHostRawUserInterface _rawui;
private readonly ConsoleHost _parent;

[TraceSourceAttribute("ConsoleHostUserInterface", "Console host's subclass of S.M.A.Host.Console")]
[TraceSource("ConsoleHostUserInterface", "Console host's subclass of S.M.A.Host.Console")]
private static readonly PSTraceSource s_tracer = PSTraceSource.GetTracer("ConsoleHostUserInterface", "Console host's subclass of S.M.A.Host.Console");
}
} // namespace
18 changes: 9 additions & 9 deletions src/Microsoft.WSMan.Management/Interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public enum AuthenticationMechanism
[ComImport]
[TypeLibType((short)4304)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -255,7 +255,7 @@ string Error
[ComImport]
[TypeLibType((short)4288)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -312,7 +312,7 @@ string Password
[ComImport]
[TypeLibType((short)4288)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand All @@ -336,7 +336,7 @@ string CertificateThumbprint
[ComImport]
[TypeLibType((short)4288)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -386,7 +386,7 @@ void SetProxy(int accessType,
[ComImport]
[TypeLibType((short)4288)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -450,7 +450,7 @@ string Error
[TypeLibType((short)4304)]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -706,7 +706,7 @@ string Error
[ComImport]
[TypeLibType((short)4288)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -860,7 +860,7 @@ string Error
[ComImport]
[TypeLibType((short)4288)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down Expand Up @@ -1005,7 +1005,7 @@ int Timeout
[ComImport]
[TypeLibType((short)400)]
#if CORECLR
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
#else
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.WSMan.Management/WSManInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public Uri ResourceURI
[Parameter(ParameterSetName = "Enumerate")]

[ValidateNotNullOrEmpty]
[ValidateSetAttribute(new string[] { "object", "epr", "objectandepr" })]
[ValidateSet(new string[] { "object", "epr", "objectandepr" })]
[Alias("RT")]
public string ReturnType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Null sink to absorb pipeline output.
/// </summary>
[CmdletAttribute("Out", "Null", SupportsShouldProcess = false,
[Cmdlet("Out", "Null", SupportsShouldProcess = false,
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2096792", RemotingCapability = RemotingCapability.None)]
public class OutNullCommand : PSCmdlet
{
Expand Down
Loading