From 39513bb3fb3af9d6aafe2eda5e134e059d3bd6fa Mon Sep 17 00:00:00 2001 From: Thomas Nieto <38873752+ThomasNieto@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:11:55 -0500 Subject: [PATCH] Remove parenthesis for empty attribute parameters (#20087) --- .../NewCimSessionCommand.cs | 2 +- .../NewCimSessionOptionCommand.cs | 2 +- .../management/ClearRecycleBinCommand.cs | 2 +- .../commands/management/Eventlog.cs | 14 +-- .../management/GetWMIObjectCommand.cs | 4 +- .../commands/management/Navigation.cs | 4 +- .../management/RegisterWMIEventCommand.cs | 2 +- .../management/StartTransactionCommand.cs | 6 +- .../commands/management/WMIHelper.cs | 2 +- .../commands/utility/AddMember.cs | 4 +- .../commands/utility/AddType.cs | 4 +- .../EnableDisableRunspaceDebugCommand.cs | 12 +- .../commands/utility/ExportAliasCommand.cs | 6 +- .../common/WriteFormatDataCommand.cs | 6 +- .../FormatAndOutput/format-hex/Format-Hex.cs | 6 +- .../FormatAndOutput/out-file/Out-File.cs | 8 +- .../commands/utility/GetEventCommand.cs | 2 +- .../utility/GetEventSubscriberCommand.cs | 2 +- .../utility/ImplicitRemotingCommands.cs | 2 +- .../commands/utility/MatchString.cs | 2 +- .../utility/UnregisterEventCommand.cs | 2 +- .../commands/utility/Update-List.cs | 10 +- .../commands/utility/Update-TypeData.cs | 4 +- .../WebCmdlet/ConvertFromJsonCommand.cs | 4 +- .../WindowsTaskbarJumpList/ComInterfaces.cs | 6 +- .../host/msh/StartTranscriptCmdlet.cs | 6 +- .../commands/RegisterJobDefinition.cs | 2 +- .../security/AclCommands.cs | 10 +- .../security/CatalogCommands.cs | 6 +- .../security/CmsCommands.cs | 14 +-- .../security/CredentialCommands.cs | 4 +- .../security/SignatureCommands.cs | 2 +- .../ConfigProvider.cs | 12 +- src/Microsoft.WSMan.Management/CredSSP.cs | 2 +- .../Set-QuickConfig.cs | 4 +- .../FormatAndOutput/out-console/OutConsole.cs | 2 +- .../engine/Credential.cs | 2 +- .../engine/InformationRecord.cs | 2 +- .../engine/MshMemberInfo.cs | 4 +- .../engine/ProgressRecord.cs | 18 +-- .../engine/hostifaces/History.cs | 4 +- .../engine/hostifaces/InformationalRecord.cs | 10 +- .../remoting/client/RemotingErrorRecord.cs | 28 ++--- .../remoting/commands/ConnectPSSession.cs | 2 +- .../commands/EnterPSHostProcessCommand.cs | 12 +- .../remoting/commands/InvokeCommandCommand.cs | 10 +- .../commands/NewPSSessionConfigurationFile.cs | 106 +++++++++--------- .../remoting/commands/PushRunspaceCommand.cs | 4 +- .../engine/remoting/commands/ReceiveJob.cs | 14 +-- .../remoting/commands/ReceivePSSession.cs | 2 +- .../engine/remoting/commands/StartJob.cs | 2 +- .../remoting/commands/getrunspacecommand.cs | 4 +- .../remoting/commands/newrunspacecommand.cs | 4 +- .../help/SaveHelpCommand.cs | 2 +- .../help/UpdatableHelpCommandBase.cs | 4 +- .../namespaces/Win32Native.cs | 2 +- .../assets/ExpTest/ExpTest.cs | 4 +- 57 files changed, 211 insertions(+), 211 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs index 56ce967b42..8b8e36cf82 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs @@ -54,7 +54,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// The default is the current user. /// [Parameter(Position = 1, ParameterSetName = CredentialParameterSet)] - [Credential()] + [Credential] public PSCredential Credential { get; set; } /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index c82a882fb2..54956a9805 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -299,7 +299,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// Ps Credential used by the proxy server when required by the server. /// [Parameter(ParameterSetName = WSManParameterSet)] - [Credential()] + [Credential] public PSCredential ProxyCredential { get diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs index 90598048f3..bc4e44220d 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs @@ -41,7 +41,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that sets force parameter. This will allow to clear the recyclebin. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs index 4732716841..3731687599 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs @@ -48,8 +48,8 @@ namespace Microsoft.PowerShell.Commands /// /// Read eventlog entries from this computer. /// - [Parameter()] - [ValidateNotNullOrEmpty()] + [Parameter] + [ValidateNotNullOrEmpty] [Alias("Cn")] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] ComputerName { get; set; } = Array.Empty(); @@ -123,7 +123,7 @@ namespace Microsoft.PowerShell.Commands /// gets or sets an array of instanceIds. /// [Parameter(Position = 1, ParameterSetName = "LogName")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [ValidateRangeAttribute((long)0, long.MaxValue)] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public long[] InstanceId @@ -144,7 +144,7 @@ namespace Microsoft.PowerShell.Commands /// gets or sets an array of indexes. /// [Parameter(ParameterSetName = "LogName")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [ValidateRangeAttribute((int)1, int.MaxValue)] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public int[] Index @@ -165,7 +165,7 @@ namespace Microsoft.PowerShell.Commands /// gets or sets an array of EntryTypes. /// [Parameter(ParameterSetName = "LogName")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [ValidateSetAttribute(new string[] { "Error", "Information", "FailureAudit", "SuccessAudit", "Warning" })] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] [Alias("ET")] @@ -186,7 +186,7 @@ namespace Microsoft.PowerShell.Commands /// Get or sets an array of Source. /// [Parameter(ParameterSetName = "LogName")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [Alias("ABO")] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] Source @@ -207,7 +207,7 @@ namespace Microsoft.PowerShell.Commands /// Get or Set Message string to searched in EventLog. /// [Parameter(ParameterSetName = "LogName")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [Alias("MSG")] public string Message { diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs index f460b2c495..85d8c4feb3 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs @@ -26,7 +26,7 @@ namespace Microsoft.PowerShell.Commands [Alias("ClassName")] [Parameter(Position = 0, Mandatory = true, ParameterSetName = "query")] [Parameter(Position = 1, ParameterSetName = "list")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string Class { get; set; } /// @@ -39,7 +39,7 @@ namespace Microsoft.PowerShell.Commands /// The WMI properties to retrieve. /// [Parameter(Position = 1, ParameterSetName = "query")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string[] Property { get { return (string[])_property.Clone(); } diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs index 6699521731..8bc149c2cf 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs @@ -283,7 +283,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the credential parameter. /// [Parameter(ValueFromPipelineByPropertyName = true)] - [Credential()] + [Credential] public PSCredential Credential { get; set; } #endregion Parameters @@ -4128,7 +4128,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the provider that will be removed. /// [Parameter(Position = 0, ValueFromPipelineByPropertyName = true)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string[] PSProvider { get => _provider; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs index 55a57073ef..0d547abfa9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs @@ -33,7 +33,7 @@ namespace Microsoft.PowerShell.Commands /// The credential to use. /// [Parameter] - [Credential()] + [Credential] public PSCredential Credential { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs index 4f5c239cc6..6c178626d9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs @@ -18,7 +18,7 @@ namespace Microsoft.PowerShell.Commands /// The time, in minutes, before this transaction is rolled back /// automatically. /// - [Parameter()] + [Parameter] [Alias("TimeoutMins")] public int Timeout { @@ -47,7 +47,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the flag to determine if this transaction can /// be committed or rolled back independently of other transactions. /// - [Parameter()] + [Parameter] public SwitchParameter Independent { get { return _independent; } @@ -60,7 +60,7 @@ namespace Microsoft.PowerShell.Commands /// /// Gets or sets the rollback preference for this transaction. /// - [Parameter()] + [Parameter] public RollbackSeverity RollbackPreference { get { return _rollbackPreference; } diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs index e617177085..31670a7d63 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs @@ -1120,7 +1120,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = "WQLQuery")] [Parameter(ParameterSetName = "query")] [Parameter(ParameterSetName = "list")] - [Credential()] + [Credential] public PSCredential Credential { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs index 29aa870fd1..604e54345d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs @@ -147,8 +147,8 @@ namespace Microsoft.PowerShell.Commands /// The name of the new NoteProperty member. /// [Parameter(Mandatory = true, Position = 0, ParameterSetName = NotePropertySingleMemberSet)] - [ValidateNotePropertyNameAttribute()] - [NotePropertyTransformationAttribute()] + [ValidateNotePropertyNameAttribute] + [NotePropertyTransformationAttribute] [ValidateNotNullOrEmpty] public string NotePropertyName { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index 4ac0f4f319..81ca82cb3c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -129,7 +129,7 @@ namespace Microsoft.PowerShell.Commands /// Any using statements required by the auto-generated type. /// [Parameter(ParameterSetName = FromMemberParameterSetName)] - [ValidateNotNull()] + [ValidateNotNull] [Alias("Using")] public string[] UsingNamespace { get; set; } = Array.Empty(); @@ -405,7 +405,7 @@ namespace Microsoft.PowerShell.Commands /// /// Flag to pass the resulting types along. /// - [Parameter()] + [Parameter] public SwitchParameter PassThru { get; set; } /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs index fdc2911fa6..47b83c7877 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs @@ -118,7 +118,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(Position = 0, ParameterSetName = CommonRunspaceCommandBase.RunspaceNameParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] RunspaceName { @@ -134,7 +134,7 @@ namespace Microsoft.PowerShell.Commands ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, ParameterSetName = CommonRunspaceCommandBase.RunspaceParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public Runspace[] Runspace { @@ -148,7 +148,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(Position = 0, Mandatory = true, ParameterSetName = CommonRunspaceCommandBase.RunspaceIdParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public int[] RunspaceId { @@ -161,7 +161,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(Position = 0, Mandatory = true, ParameterSetName = CommonRunspaceCommandBase.RunspaceInstanceIdParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public System.Guid[] RunspaceInstanceId { @@ -173,7 +173,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or Sets the ProcessName for which runspace debugging has to be enabled or disabled. /// [Parameter(Position = 0, ParameterSetName = CommonRunspaceCommandBase.ProcessNameParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string ProcessName { get; @@ -184,7 +184,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or Sets the AppDomain Names for which runspace debugging has to be enabled or disabled. /// [Parameter(Position = 1, ParameterSetName = CommonRunspaceCommandBase.ProcessNameParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Scope = "member", Target = "Microsoft.PowerShell.Commands.CommonRunspaceCommandBase.#AppDomainName")] public string[] AppDomainName diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs index 641d4436da..33deb01eb2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs @@ -117,7 +117,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that sets append parameter. /// - [Parameter()] + [Parameter] public SwitchParameter Append { get @@ -136,7 +136,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that sets force parameter. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get @@ -155,7 +155,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that prevents file overwrite. /// - [Parameter()] + [Parameter] [Alias("NoOverwrite")] public SwitchParameter NoClobber { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs index 3ccbe94282..c07539aa25 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs @@ -81,7 +81,7 @@ namespace Microsoft.PowerShell.Commands /// /// Force writing a file. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get @@ -98,7 +98,7 @@ namespace Microsoft.PowerShell.Commands /// /// Do not overwrite file if exists. /// - [Parameter()] + [Parameter] [Alias("NoOverwrite")] public SwitchParameter NoClobber { @@ -118,7 +118,7 @@ namespace Microsoft.PowerShell.Commands /// /// Include scriptblocks for export. /// - [Parameter()] + [Parameter] public SwitchParameter IncludeScriptBlock { get diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs index 48cc45a48d..2f2536d361 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs @@ -47,14 +47,14 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the path of file(s) to process. /// [Parameter(Mandatory = true, Position = 0, ParameterSetName = "Path")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string[] Path { get; set; } /// /// Gets or sets the literal path of file to process. /// [Parameter(Mandatory = true, ParameterSetName = "LiteralPath")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [Alias("PSPath", "LP")] public string[] LiteralPath { get; set; } @@ -68,7 +68,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the type of character encoding for InputObject. /// [Parameter(ParameterSetName = "ByInputObject")] - [ArgumentToEncodingTransformationAttribute()] + [ArgumentToEncodingTransformationAttribute] [ArgumentEncodingCompletionsAttribute] [ValidateNotNullOrEmpty] public Encoding Encoding diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs index 50025b12f9..751b5ab0d9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs @@ -74,7 +74,7 @@ namespace Microsoft.PowerShell.Commands /// Encoding optional flag. /// [Parameter(Position = 1)] - [ArgumentToEncodingTransformationAttribute()] + [ArgumentToEncodingTransformationAttribute] [ArgumentEncodingCompletionsAttribute] [ValidateNotNullOrEmpty] public Encoding Encoding @@ -96,7 +96,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that sets append parameter. /// - [Parameter()] + [Parameter] public SwitchParameter Append { get { return _append; } @@ -109,7 +109,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that sets force parameter. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get { return _force; } @@ -122,7 +122,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that prevents file overwrite. /// - [Parameter()] + [Parameter] [Alias("NoOverwrite")] public SwitchParameter NoClobber { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs index 42360983c4..f4ab18ac75 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs @@ -20,7 +20,7 @@ namespace Microsoft.PowerShell.Commands /// An identifier for this event subscription. /// [Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = "BySource")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string SourceIdentifier { get diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs index b3bd99b7bd..f95c708fa5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs @@ -20,7 +20,7 @@ namespace Microsoft.PowerShell.Commands /// An identifier for this event subscription. /// [Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = "BySource")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string SourceIdentifier { get diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index 1631bb1876..6dbbc04fea 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -73,7 +73,7 @@ namespace Microsoft.PowerShell.Commands /// Encoding optional flag. /// [Parameter] - [ArgumentToEncodingTransformationAttribute()] + [ArgumentToEncodingTransformationAttribute] [ArgumentEncodingCompletionsAttribute] [ValidateNotNullOrEmpty] public Encoding Encoding diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs index a149c1b10e..b93280f619 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs @@ -1336,7 +1336,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the text encoding to process each file as. /// [Parameter] - [ArgumentToEncodingTransformationAttribute()] + [ArgumentToEncodingTransformationAttribute] [ArgumentEncodingCompletionsAttribute] [ValidateNotNullOrEmpty] public Encoding Encoding diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs index f0f87eb9f6..cf65a1f73b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs @@ -47,7 +47,7 @@ namespace Microsoft.PowerShell.Commands /// /// Flag that determines if we should include subscriptions used to support other subscriptions. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get; set; } #endregion parameters diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-List.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-List.cs index b5659f8e90..99507d0461 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-List.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-List.cs @@ -26,7 +26,7 @@ namespace Microsoft.PowerShell.Commands /// Objects to add to the list. /// [Parameter(ParameterSetName = "AddRemoveSet")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")] public object[] Add { get; set; } @@ -35,7 +35,7 @@ namespace Microsoft.PowerShell.Commands /// Objects to be removed from the list. /// [Parameter(ParameterSetName = "AddRemoveSet")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")] public object[] Remove { get; set; } @@ -44,7 +44,7 @@ namespace Microsoft.PowerShell.Commands /// Objects in this list replace the objects in the target list. /// [Parameter(Mandatory = true, ParameterSetName = "ReplaceSet")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")] public object[] Replace { get; set; } @@ -55,7 +55,7 @@ namespace Microsoft.PowerShell.Commands // [Parameter(ValueFromPipeline = true, ParameterSetName = "AddRemoveSet")] // [Parameter(ValueFromPipeline = true, ParameterSetName = "ReplaceSet")] [Parameter(ValueFromPipeline = true)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public PSObject InputObject { get; set; } /// @@ -65,7 +65,7 @@ namespace Microsoft.PowerShell.Commands // [Parameter(Position = 0, ParameterSetName = "AddRemoveSet")] // [Parameter(Position = 0, ParameterSetName = "ReplaceSet")] [Parameter(Position = 0)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string Property { get; set; } private PSListModifier _listModifier; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs index 675df27418..d181112ec8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs @@ -260,7 +260,7 @@ namespace Microsoft.PowerShell.Commands /// The type name we want to update on. /// [Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = DynamicTypeSet)] - [ArgumentToTypeNameTransformationAttribute()] + [ArgumentToTypeNameTransformationAttribute] [ValidateNotNullOrEmpty] public string TypeName { @@ -1055,7 +1055,7 @@ namespace Microsoft.PowerShell.Commands /// The target type to remove. /// [Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = RemoveTypeSet)] - [ArgumentToTypeNameTransformationAttribute()] + [ArgumentToTypeNameTransformationAttribute] [ValidateNotNullOrEmpty] public string TypeName { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs index 392a58e13d..66313f832d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs @@ -32,13 +32,13 @@ namespace Microsoft.PowerShell.Commands /// /// Returned data structure is a Hashtable instead a CustomPSObject. /// - [Parameter()] + [Parameter] public SwitchParameter AsHashtable { get; set; } /// /// Gets or sets the maximum depth the JSON input is allowed to have. By default, it is 1024. /// - [Parameter()] + [Parameter] [ValidateRange(ValidateRangeKind.Positive)] public int Depth { get; set; } = 1024; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs index 7aa0b63447..8cc6bd8ab0 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs @@ -160,7 +160,7 @@ namespace Microsoft.PowerShell HResult Commit(); } - [ComImport()] + [ComImport] [Guid("6332DEBF-87B5-4670-90C0-5E57B408A49E")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ICustomDestinationList @@ -204,7 +204,7 @@ namespace Microsoft.PowerShell Recent } - [ComImport()] + [ComImport] [Guid("92CA9DCD-5622-4BBA-A805-5E9F541BD8C9")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IObjectArray @@ -217,7 +217,7 @@ namespace Microsoft.PowerShell [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject); } - [ComImport()] + [ComImport] [Guid("5632B1A4-E38A-400A-928A-D4CD63230295")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] internal interface IObjectCollection diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs index dadc5117ab..b220eae3bf 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs @@ -96,7 +96,7 @@ namespace Microsoft.PowerShell.Commands /// /// The read-only attribute will not be replaced when the transcript is done. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get @@ -115,7 +115,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that prevents file overwrite. /// - [Parameter()] + [Parameter] [Alias("NoOverwrite")] public SwitchParameter NoClobber { @@ -135,7 +135,7 @@ namespace Microsoft.PowerShell.Commands /// /// Whether to include command invocation time headers between commands. /// - [Parameter()] + [Parameter] public SwitchParameter IncludeInvocationHeader { get; set; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs index e473f91dfd..608f6bcfd9 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs @@ -125,7 +125,7 @@ namespace Microsoft.PowerShell.ScheduledJob /// [Parameter(ParameterSetName = RegisterScheduledJobCommand.FilePathParameterSet)] [Parameter(ParameterSetName = RegisterScheduledJobCommand.ScriptBlockParameterSet)] - [Credential()] + [Credential] public PSCredential Credential { get { return _credential; } diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 8cff78e1bf..829df70d25 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -623,7 +623,7 @@ namespace Microsoft.PowerShell.Commands /// security descriptor. Default is the current location. /// [Parameter(Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByPath")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string[] Path { get @@ -663,7 +663,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByLiteralPath")] [Alias("PSPath")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LiteralPath { @@ -685,7 +685,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the audit flag of the command. This flag /// determines if audit rules should also be retrieved. /// - [Parameter()] + [Parameter] public SwitchParameter Audit { get @@ -716,7 +716,7 @@ namespace Microsoft.PowerShell.Commands /// determines whether the information about all central access policies /// available on the machine should be displayed. /// - [Parameter()] + [Parameter] public SwitchParameter AllCentralAccessPolicies { get @@ -1025,7 +1025,7 @@ namespace Microsoft.PowerShell.Commands /// If true, the security descriptor is also passed /// down the output pipeline. /// - [Parameter()] + [Parameter] public SwitchParameter Passthru { get diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index a86bf65785..d96538141d 100644 --- a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs @@ -145,7 +145,7 @@ namespace Microsoft.PowerShell.Commands /// /// Catalog version. /// - [Parameter()] + [Parameter] public int CatalogVersion { get @@ -223,7 +223,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter Detailed { get { return detailed; } @@ -236,7 +236,7 @@ namespace Microsoft.PowerShell.Commands /// /// Patterns used to exclude files from DiskPaths and Catalog. /// - [Parameter()] + [Parameter] public string[] FilesToSkip { get diff --git a/src/Microsoft.PowerShell.Security/security/CmsCommands.cs b/src/Microsoft.PowerShell.Security/security/CmsCommands.cs index 4983ed2272..5e8e6d19b4 100644 --- a/src/Microsoft.PowerShell.Security/security/CmsCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CmsCommands.cs @@ -35,8 +35,8 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the content of the CMS Message. /// [Parameter(Position = 1, Mandatory = true, ValueFromPipeline = true, ParameterSetName = "ByContent")] - [AllowNull()] - [AllowEmptyString()] + [AllowNull] + [AllowEmptyString] public PSObject Content { get; @@ -202,8 +202,8 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the content of the CMS Message. /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ParameterSetName = "ByContent")] - [AllowNull()] - [AllowEmptyString()] + [AllowNull] + [AllowEmptyString] public string Content { get; @@ -350,8 +350,8 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets the content of the CMS Message. /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = "ByContent")] - [AllowNull()] - [AllowEmptyString()] + [AllowNull] + [AllowEmptyString] public string Content { get; @@ -397,7 +397,7 @@ namespace Microsoft.PowerShell.Commands /// Determines whether to include the decrypted content in its original context, /// rather than just output the decrypted content itself. /// - [Parameter()] + [Parameter] public SwitchParameter IncludeContext { get; diff --git a/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs b/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs index e056f13468..cc354ee153 100644 --- a/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs @@ -33,7 +33,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(Position = 0, ParameterSetName = credentialSet)] [ValidateNotNull] - [Credential()] + [Credential] public PSCredential Credential { get; set; } /// @@ -55,7 +55,7 @@ namespace Microsoft.PowerShell.Commands /// Gets and sets the user supplied username to be used while creating the PSCredential. /// [Parameter(Position = 0, Mandatory = false, ParameterSetName = messageSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string UserName { get { return _userName; } diff --git a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs index 09fefdfb8e..581266d3ad 100644 --- a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs @@ -406,7 +406,7 @@ namespace Microsoft.PowerShell.Commands /// /// Property that sets force parameter. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index 7af916e625..f1fc3a3627 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -5756,7 +5756,7 @@ namespace Microsoft.WSMan.Management /// Parameter for RunAs credentials for a Plugin. /// [ValidateNotNull] - [Parameter()] + [Parameter] public PSCredential RunAsCredential { get { return this.runAsCredentials; } @@ -5769,7 +5769,7 @@ namespace Microsoft.WSMan.Management /// /// Parameter for Plugin Host Process configuration (Shared or Separate). /// - [Parameter()] + [Parameter] public SwitchParameter UseSharedProcess { get { return this.sharedHost; } @@ -5782,7 +5782,7 @@ namespace Microsoft.WSMan.Management /// /// Parameter for Auto Restart configuration for Plugin. /// - [Parameter()] + [Parameter] public SwitchParameter AutoRestart { get { return this.autoRestart; } @@ -5795,7 +5795,7 @@ namespace Microsoft.WSMan.Management /// /// Parameter for Idle timeout for HostProcess. /// - [Parameter()] + [Parameter] public uint? ProcessIdleTimeoutSec { get @@ -5936,7 +5936,7 @@ namespace Microsoft.WSMan.Management /// /// Parameter Subject. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public string Subject { @@ -6181,7 +6181,7 @@ namespace Microsoft.WSMan.Management /// /// Parameter Concatenate. /// - [Parameter()] + [Parameter] public SwitchParameter Concatenate { get { return _concatenate; } diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index c59daa39bf..03c71f0edb 100644 --- a/src/Microsoft.WSMan.Management/CredSSP.cs +++ b/src/Microsoft.WSMan.Management/CredSSP.cs @@ -413,7 +413,7 @@ namespace Microsoft.WSMan.Management /// /// Property that sets force parameter. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get { return force; } diff --git a/src/Microsoft.WSMan.Management/Set-QuickConfig.cs b/src/Microsoft.WSMan.Management/Set-QuickConfig.cs index 1ee927558f..9ad9e39c33 100644 --- a/src/Microsoft.WSMan.Management/Set-QuickConfig.cs +++ b/src/Microsoft.WSMan.Management/Set-QuickConfig.cs @@ -56,7 +56,7 @@ namespace Microsoft.WSMan.Management /// Property that sets force parameter. This will allow /// configuring WinRM without prompting the user. /// - [Parameter()] + [Parameter] public SwitchParameter Force { get { return force; } @@ -69,7 +69,7 @@ namespace Microsoft.WSMan.Management /// /// Property that will allow configuring WinRM with Public profile exception enabled. /// - [Parameter()] + [Parameter] public SwitchParameter SkipNetworkProfileCheck { get { return skipNetworkProfileCheck; } diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs index 8629afe87a..60c5c2c000 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs @@ -49,7 +49,7 @@ namespace Microsoft.PowerShell.Commands /// invoked via API. This ensures that the objects pass through the formatting and output /// system, but can still make it to the API consumer. /// - [Parameter()] + [Parameter] public SwitchParameter Transcript { get; set; } /// diff --git a/src/System.Management.Automation/engine/Credential.cs b/src/System.Management.Automation/engine/Credential.cs index 5797a8dfcd..b2be0dbfd2 100644 --- a/src/System.Management.Automation/engine/Credential.cs +++ b/src/System.Management.Automation/engine/Credential.cs @@ -85,7 +85,7 @@ namespace System.Management.Automation /// Offers a centralized way to manage usernames, passwords, and /// credentials. /// - [Serializable()] + [Serializable] public sealed class PSCredential : ISerializable { /// diff --git a/src/System.Management.Automation/engine/InformationRecord.cs b/src/System.Management.Automation/engine/InformationRecord.cs index d69ad1d14b..87a3d9cda9 100644 --- a/src/System.Management.Automation/engine/InformationRecord.cs +++ b/src/System.Management.Automation/engine/InformationRecord.cs @@ -14,7 +14,7 @@ namespace System.Management.Automation /// which, according to host or user preference, forwards that information on to the host for rendering to the user. /// /// - [DataContract()] + [DataContract] public class InformationRecord { /// diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index fe04121220..369e0f3fcd 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -29,7 +29,7 @@ namespace System.Management.Automation /// Enumerates all possible types of members. /// [TypeConverterAttribute(typeof(LanguagePrimitives.EnumMultipleTypeConverter))] - [FlagsAttribute()] + [FlagsAttribute] public enum PSMemberTypes { /// @@ -121,7 +121,7 @@ namespace System.Management.Automation /// Enumerator for all possible views available on a PSObject. /// [TypeConverterAttribute(typeof(LanguagePrimitives.EnumMultipleTypeConverter))] - [FlagsAttribute()] + [FlagsAttribute] public enum PSMemberViewTypes { /// diff --git a/src/System.Management.Automation/engine/ProgressRecord.cs b/src/System.Management.Automation/engine/ProgressRecord.cs index 7d044bf2be..8dca2c6d7f 100644 --- a/src/System.Management.Automation/engine/ProgressRecord.cs +++ b/src/System.Management.Automation/engine/ProgressRecord.cs @@ -15,7 +15,7 @@ namespace System.Management.Automation /// which, according to user preference, forwards that information on to the host for rendering to the user. /// /// - [DataContract()] + [DataContract] public class ProgressRecord { @@ -429,28 +429,28 @@ namespace System.Management.Automation #region DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting compatibility with Windows PowerShell - [DataMemberAttribute()] + [DataMemberAttribute] private readonly int id; - [DataMemberAttribute()] + [DataMemberAttribute] private int parentId = -1; - [DataMemberAttribute()] + [DataMemberAttribute] private string activity; - [DataMemberAttribute()] + [DataMemberAttribute] private string status; - [DataMemberAttribute()] + [DataMemberAttribute] private string currentOperation; - [DataMemberAttribute()] + [DataMemberAttribute] private int percent = -1; - [DataMemberAttribute()] + [DataMemberAttribute] private int secondsRemaining = -1; - [DataMemberAttribute()] + [DataMemberAttribute] private ProgressRecordType type = ProgressRecordType.Processing; #endregion diff --git a/src/System.Management.Automation/engine/hostifaces/History.cs b/src/System.Management.Automation/engine/hostifaces/History.cs index a061078f63..ba69da88dd 100644 --- a/src/System.Management.Automation/engine/hostifaces/History.cs +++ b/src/System.Management.Automation/engine/hostifaces/History.cs @@ -1346,7 +1346,7 @@ namespace Microsoft.PowerShell.Commands /// A Boolean that indicates whether history objects should be /// passed to the next element in the pipeline. /// - [Parameter()] + [Parameter] public SwitchParameter Passthru { get { return _passthru; } @@ -1542,7 +1542,7 @@ namespace Microsoft.PowerShell.Commands /// Command line name of an entry in the session history. /// [Parameter(ParameterSetName = "CommandLineParameter", HelpMessage = "Specifies the name of a command in the session history")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] CommandLine { diff --git a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs index 3fdba5569c..f8196167c3 100644 --- a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs +++ b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs @@ -13,7 +13,7 @@ namespace System.Management.Automation /// A PSInformationalRecord consists of a string Message and the InvocationInfo and pipeline state corresponding /// to the command that created the record. /// - [DataContract()] + [DataContract] public abstract class InformationalRecord { /// @@ -159,7 +159,7 @@ namespace System.Management.Automation } } - [DataMember()] + [DataMember] private string _message; private InvocationInfo _invocationInfo; @@ -170,7 +170,7 @@ namespace System.Management.Automation /// /// A warning record in the PSInformationalBuffers. /// - [DataContract()] + [DataContract] public class WarningRecord : InformationalRecord { /// @@ -226,7 +226,7 @@ namespace System.Management.Automation /// /// A debug record in the PSInformationalBuffers. /// - [DataContract()] + [DataContract] public class DebugRecord : InformationalRecord { /// @@ -247,7 +247,7 @@ namespace System.Management.Automation /// /// A verbose record in the PSInformationalBuffers. /// - [DataContract()] + [DataContract] public class VerboseRecord : InformationalRecord { /// diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs index 07dfd9db8a..bb527828a4 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs @@ -90,7 +90,7 @@ namespace System.Management.Automation.Runspaces /// /// Progress record containing origin information. /// - [DataContract()] + [DataContract] public class RemotingProgressRecord : ProgressRecord { /// @@ -101,7 +101,7 @@ namespace System.Management.Automation.Runspaces get { return _originInfo; } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly OriginInfo _originInfo; /// @@ -139,7 +139,7 @@ namespace System.Management.Automation.Runspaces /// /// Warning record containing origin information. /// - [DataContract()] + [DataContract] public class RemotingWarningRecord : WarningRecord { /// @@ -150,7 +150,7 @@ namespace System.Management.Automation.Runspaces get { return _originInfo; } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly OriginInfo _originInfo; /// @@ -181,7 +181,7 @@ namespace System.Management.Automation.Runspaces /// /// Debug record containing origin information. /// - [DataContract()] + [DataContract] public class RemotingDebugRecord : DebugRecord { /// @@ -192,7 +192,7 @@ namespace System.Management.Automation.Runspaces get { return _originInfo; } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly OriginInfo _originInfo; /// @@ -210,7 +210,7 @@ namespace System.Management.Automation.Runspaces /// /// Verbose record containing origin information. /// - [DataContract()] + [DataContract] public class RemotingVerboseRecord : VerboseRecord { /// @@ -221,7 +221,7 @@ namespace System.Management.Automation.Runspaces get { return _originInfo; } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly OriginInfo _originInfo; /// @@ -239,7 +239,7 @@ namespace System.Management.Automation.Runspaces /// /// Information record containing origin information. /// - [DataContract()] + [DataContract] public class RemotingInformationRecord : InformationRecord { /// @@ -250,7 +250,7 @@ namespace System.Management.Automation.Runspaces get { return _originInfo; } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly OriginInfo _originInfo; /// @@ -276,7 +276,7 @@ namespace System.Management.Automation.Remoting /// In case of output objects, the information /// should directly be added to the object as /// properties - [DataContract()] + [DataContract] public class OriginInfo { /// @@ -292,7 +292,7 @@ namespace System.Management.Automation.Remoting } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly string _computerName; /// @@ -307,7 +307,7 @@ namespace System.Management.Automation.Remoting } } - [DataMemberAttribute()] + [DataMemberAttribute] private readonly Guid _runspaceID; /// @@ -327,7 +327,7 @@ namespace System.Management.Automation.Remoting } } - [DataMemberAttribute()] + [DataMemberAttribute] private Guid _instanceId; /// diff --git a/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs b/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs index a1d993a654..b7474fe34c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs @@ -205,7 +205,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = ConnectPSSessionCommand.ComputerNameGuidParameterSet)] [Parameter(ParameterSetName = ConnectPSSessionCommand.ConnectionUriParameterSet)] [Parameter(ParameterSetName = ConnectPSSessionCommand.ConnectionUriGuidParameterSet)] - [Credential()] + [Credential] public PSCredential Credential { get diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs index 5acd33b292..f7aef0530b 100644 --- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs @@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.Commands /// Process to enter. /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ParameterSetName = EnterPSHostProcessCommand.ProcessParameterSet)] - [ValidateNotNull()] + [ValidateNotNull] public Process Process { get; @@ -76,7 +76,7 @@ namespace Microsoft.PowerShell.Commands /// Name of process to enter. An error will result if more than one such process exists. /// [Parameter(Position = 0, Mandatory = true, ParameterSetName = EnterPSHostProcessCommand.ProcessNameParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string Name { get; @@ -87,7 +87,7 @@ namespace Microsoft.PowerShell.Commands /// Host Process Info object that describes a connectible process. /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ParameterSetName = EnterPSHostProcessCommand.PSHostProcessInfoParameterSet)] - [ValidateNotNull()] + [ValidateNotNull] public PSHostProcessInfo HostProcessInfo { get; @@ -500,7 +500,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(Position = 0, ParameterSetName = GetPSHostProcessInfoCommand.ProcessNameParameterSet)] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public string[] Name { get; @@ -512,7 +512,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ParameterSetName = GetPSHostProcessInfoCommand.ProcessParameterSet)] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public Process[] Process { get; @@ -524,7 +524,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(Position = 0, Mandatory = true, ParameterSetName = GetPSHostProcessInfoCommand.ProcessIdParameterSet)] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public int[] Id { get; diff --git a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs index 9ee5969aff..534362b0f1 100644 --- a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs @@ -198,7 +198,7 @@ namespace Microsoft.PowerShell.Commands ParameterSetName = InvokeCommandCommand.FilePathVMIdParameterSet)] [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true, ParameterSetName = InvokeCommandCommand.FilePathVMNameParameterSet)] - [Credential()] + [Credential] public override PSCredential Credential { get @@ -702,7 +702,7 @@ namespace Microsoft.PowerShell.Commands ParameterSetName = InvokeCommandCommand.SSHHostParameterSet)] [Parameter(Mandatory = true, ParameterSetName = InvokeCommandCommand.FilePathSSHHostParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public override string[] HostName { get { return base.HostName; } @@ -715,7 +715,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(ParameterSetName = InvokeCommandCommand.SSHHostParameterSet)] [Parameter(ParameterSetName = InvokeCommandCommand.FilePathSSHHostParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public override string UserName { get { return base.UserName; } @@ -728,7 +728,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(ParameterSetName = InvokeCommandCommand.SSHHostParameterSet)] [Parameter(ParameterSetName = InvokeCommandCommand.FilePathSSHHostParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] [Alias("IdentityFilePath")] public override string KeyFilePath { @@ -785,7 +785,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(ParameterSetName = PSRemotingBaseCmdlet.SSHHostHashParameterSet, Mandatory = true)] [Parameter(ParameterSetName = InvokeCommandCommand.FilePathSSHHostHashParameterSet, Mandatory = true)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public override Hashtable[] SSHConnection { get; diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs index 07258e80a9..4e669e891f 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs @@ -48,7 +48,7 @@ namespace Microsoft.PowerShell.Commands /// /// Configuration file schema version. /// - [Parameter()] + [Parameter] [ValidateNotNull] public Version SchemaVersion { @@ -68,7 +68,7 @@ namespace Microsoft.PowerShell.Commands /// /// Configuration file GUID. /// - [Parameter()] + [Parameter] public Guid Guid { get @@ -87,7 +87,7 @@ namespace Microsoft.PowerShell.Commands /// /// Author of the configuration file. /// - [Parameter()] + [Parameter] public string Author { get @@ -106,7 +106,7 @@ namespace Microsoft.PowerShell.Commands /// /// Description. /// - [Parameter()] + [Parameter] public string Description { get @@ -125,7 +125,7 @@ namespace Microsoft.PowerShell.Commands /// /// Company name. /// - [Parameter()] + [Parameter] public string CompanyName { get @@ -144,7 +144,7 @@ namespace Microsoft.PowerShell.Commands /// /// Copyright information. /// - [Parameter()] + [Parameter] public string Copyright { get @@ -163,7 +163,7 @@ namespace Microsoft.PowerShell.Commands /// /// Specifies type of initial session state to use. /// - [Parameter()] + [Parameter] public SessionType SessionType { get @@ -182,7 +182,7 @@ namespace Microsoft.PowerShell.Commands /// /// Specifies the directory for transcripts to be placed. /// - [Parameter()] + [Parameter] public string TranscriptDirectory { get @@ -201,13 +201,13 @@ namespace Microsoft.PowerShell.Commands /// /// Specifies whether to run this configuration under a virtual account. /// - [Parameter()] + [Parameter] public SwitchParameter RunAsVirtualAccount { get; set; } /// /// Specifies groups a virtual account is part of. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] RunAsVirtualAccountGroups { get; set; } @@ -216,7 +216,7 @@ namespace Microsoft.PowerShell.Commands /// The User drive is used with Copy-Item for file transfer when the FileSystem provider is /// not visible in the session. /// - [Parameter()] + [Parameter] public SwitchParameter MountUserDrive { get; @@ -228,7 +228,7 @@ namespace Microsoft.PowerShell.Commands /// MountUserDrive parameter. /// If no maximum size is specified then the default drive maximum size is 50MB. /// - [Parameter()] + [Parameter] public long UserDriveMaximumSize { get; set; } // Temporarily removed until script input parameter validation is implemented. @@ -239,7 +239,7 @@ namespace Microsoft.PowerShell.Commands /// If a MountUserDrive is specified for the PSSession then input parameter validation will be /// enabled automatically. /// - [Parameter()] + [Parameter] public SwitchParameter EnforceInputParameterValidation { get; set; } */ @@ -247,13 +247,13 @@ namespace Microsoft.PowerShell.Commands /// Optional parameter that specifies a Group Managed Service Account name in which the configuration /// is run. /// - [Parameter()] + [Parameter] public string GroupManagedServiceAccount { get; set; } /// /// Scripts to process. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] ScriptsToProcess { @@ -273,7 +273,7 @@ namespace Microsoft.PowerShell.Commands /// /// Role definitions for this session configuration (Role name -> Role capability) /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IDictionary RoleDefinitions { @@ -293,7 +293,7 @@ namespace Microsoft.PowerShell.Commands /// /// Specifies account groups that are membership requirements for this session. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IDictionary RequiredGroups { @@ -307,7 +307,7 @@ namespace Microsoft.PowerShell.Commands /// /// Language mode. /// - [Parameter()] + [Parameter] public PSLanguageMode LanguageMode { get @@ -328,7 +328,7 @@ namespace Microsoft.PowerShell.Commands /// /// Execution policy. /// - [Parameter()] + [Parameter] public ExecutionPolicy ExecutionPolicy { get @@ -347,7 +347,7 @@ namespace Microsoft.PowerShell.Commands /// /// PowerShell version. /// - [Parameter()] + [Parameter] public Version PowerShellVersion { get @@ -366,7 +366,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of modules to import. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] ModulesToImport { @@ -386,7 +386,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible aliases. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] VisibleAliases { @@ -406,7 +406,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible cmdlets. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] VisibleCmdlets { @@ -426,7 +426,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible functions. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] VisibleFunctions { @@ -446,7 +446,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible external commands (scripts and applications) /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] VisibleExternalCommands { @@ -466,7 +466,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of providers. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] VisibleProviders { @@ -486,7 +486,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of aliases. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public IDictionary[] AliasDefinitions { @@ -506,7 +506,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of functions. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public IDictionary[] FunctionDefinitions { @@ -526,7 +526,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of variables. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object VariableDefinitions { @@ -546,7 +546,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of environment variables. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IDictionary EnvironmentVariables @@ -567,7 +567,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of types to process. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] TypesToProcess { @@ -587,7 +587,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of format data to process. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] FormatsToProcess { @@ -607,7 +607,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of assemblies to load. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] AssembliesToLoad { @@ -628,7 +628,7 @@ namespace Microsoft.PowerShell.Commands /// Gets or sets whether to include a full expansion of all possible session configuration /// keys as comments when creating the session configuration file. /// - [Parameter()] + [Parameter] public SwitchParameter Full { get; set; } #endregion @@ -1159,7 +1159,7 @@ namespace Microsoft.PowerShell.Commands /// /// Configuration file GUID. /// - [Parameter()] + [Parameter] public Guid Guid { get @@ -1178,7 +1178,7 @@ namespace Microsoft.PowerShell.Commands /// /// Author of the configuration file. /// - [Parameter()] + [Parameter] public string Author { get @@ -1197,7 +1197,7 @@ namespace Microsoft.PowerShell.Commands /// /// Description. /// - [Parameter()] + [Parameter] public string Description { get @@ -1216,7 +1216,7 @@ namespace Microsoft.PowerShell.Commands /// /// Company name. /// - [Parameter()] + [Parameter] public string CompanyName { get @@ -1235,7 +1235,7 @@ namespace Microsoft.PowerShell.Commands /// /// Copyright information. /// - [Parameter()] + [Parameter] public string Copyright { get @@ -1254,7 +1254,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of modules to import. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] ModulesToImport { @@ -1274,7 +1274,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible aliases. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] VisibleAliases { @@ -1294,7 +1294,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible cmdlets. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] VisibleCmdlets { @@ -1314,7 +1314,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible functions. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] VisibleFunctions { @@ -1334,7 +1334,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of visible external commands (scripts and applications) /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] VisibleExternalCommands { @@ -1354,7 +1354,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of providers. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] VisibleProviders { @@ -1374,7 +1374,7 @@ namespace Microsoft.PowerShell.Commands /// /// Scripts to process. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] ScriptsToProcess { @@ -1394,7 +1394,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of aliases. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public IDictionary[] AliasDefinitions { @@ -1414,7 +1414,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of functions. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public IDictionary[] FunctionDefinitions { @@ -1434,7 +1434,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of variables. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object VariableDefinitions { @@ -1454,7 +1454,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of environment variables. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IDictionary EnvironmentVariables @@ -1475,7 +1475,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of types to process. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] TypesToProcess { @@ -1495,7 +1495,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of format data to process. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] FormatsToProcess { @@ -1515,7 +1515,7 @@ namespace Microsoft.PowerShell.Commands /// /// A list of assemblies to load. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] AssembliesToLoad { diff --git a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs index fad0f604c5..8b76f0e2b9 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs @@ -55,7 +55,7 @@ namespace Microsoft.PowerShell.Commands /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ParameterSetName = PSRemotingBaseCmdlet.SSHHostParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public new string HostName { get; set; } /// @@ -170,7 +170,7 @@ namespace Microsoft.PowerShell.Commands ParameterSetName = VMIdParameterSet)] [Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = VMNameParameterSet)] - [Credential()] + [Credential] public override PSCredential Credential { get { return base.Credential; } diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs index 3bddc67613..b1759d6a88 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs @@ -171,7 +171,7 @@ namespace Microsoft.PowerShell.Commands /// If the results need to be not removed from the store /// after being written. Default is results are removed. /// - [Parameter()] + [Parameter] public SwitchParameter Keep { get @@ -190,7 +190,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter NoRecurse { get @@ -208,7 +208,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter Force { get; set; } @@ -245,7 +245,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter Wait { get @@ -262,7 +262,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter AutoRemoveJob { get @@ -278,7 +278,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter WriteEvents { get @@ -294,7 +294,7 @@ namespace Microsoft.PowerShell.Commands /// /// - [Parameter()] + [Parameter] public SwitchParameter WriteJobInResults { get diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs b/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs index 144a9c26b3..b5a3462151 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs @@ -260,7 +260,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = ReceivePSSessionCommand.ComputerSessionNameParameterSet)] [Parameter(ParameterSetName = ReceivePSSessionCommand.ConnectionUriSessionNameParameterSet)] [Parameter(ParameterSetName = ReceivePSSessionCommand.ConnectionUriInstanceIdParameterSet)] - [Credential()] + [Credential] public PSCredential Credential { get diff --git a/src/System.Management.Automation/engine/remoting/commands/StartJob.cs b/src/System.Management.Automation/engine/remoting/commands/StartJob.cs index fba57ee210..05611d8c0a 100644 --- a/src/System.Management.Automation/engine/remoting/commands/StartJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/StartJob.cs @@ -222,7 +222,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = StartJobCommand.FilePathComputerNameParameterSet)] [Parameter(ParameterSetName = StartJobCommand.ComputerNameParameterSet)] [Parameter(ParameterSetName = StartJobCommand.LiteralFilePathComputerNameParameterSet)] - [Credential()] + [Credential] public override PSCredential Credential { get diff --git a/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs index 1312c5f5c4..dd5a66ef4b 100644 --- a/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs @@ -161,7 +161,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = GetPSSessionCommand.ContainerIdParameterSet)] [Parameter(ParameterSetName = GetPSSessionCommand.VMIdParameterSet)] [Parameter(ParameterSetName = GetPSSessionCommand.VMNameParameterSet)] - [ValidateNotNullOrEmpty()] + [ValidateNotNullOrEmpty] public override string[] Name { get { return base.Name; } @@ -202,7 +202,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = GetPSSessionCommand.ComputerInstanceIdParameterSet)] [Parameter(ParameterSetName = GetPSSessionCommand.ConnectionUriParameterSet)] [Parameter(ParameterSetName = GetPSSessionCommand.ConnectionUriInstanceIdParameterSet)] - [Credential()] + [Credential] public PSCredential Credential { get diff --git a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs index bb858169f2..70ac635977 100644 --- a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs @@ -88,7 +88,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = PSRemotingBaseCmdlet.VMNameParameterSet)] - [Credential()] + [Credential] public override PSCredential Credential { get @@ -129,7 +129,7 @@ namespace Microsoft.PowerShell.Commands /// /// Friendly names for the new PSSessions. /// - [Parameter()] + [Parameter] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] Name { get; set; } diff --git a/src/System.Management.Automation/help/SaveHelpCommand.cs b/src/System.Management.Automation/help/SaveHelpCommand.cs index 7f42a25a99..2cefef9e23 100644 --- a/src/System.Management.Automation/help/SaveHelpCommand.cs +++ b/src/System.Management.Automation/help/SaveHelpCommand.cs @@ -88,7 +88,7 @@ namespace Microsoft.PowerShell.Commands [Parameter(Position = 1, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, ParameterSetName = LiteralPathParameterSetName)] [Alias("Name")] [ValidateNotNull] - [ArgumentToModuleTransformationAttribute()] + [ArgumentToModuleTransformationAttribute] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public PSModuleInfo[] Module { get; set; } diff --git a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs index 85d7b3a81c..dad75a6b69 100644 --- a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs +++ b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs @@ -78,8 +78,8 @@ namespace Microsoft.PowerShell.Commands /// /// Gets or sets the credential parameter. /// - [Parameter()] - [Credential()] + [Parameter] + [Credential] public PSCredential Credential { get { return _credential; } diff --git a/src/System.Management.Automation/namespaces/Win32Native.cs b/src/System.Management.Automation/namespaces/Win32Native.cs index b9c7d8a7a7..3814058bd0 100644 --- a/src/System.Management.Automation/namespaces/Win32Native.cs +++ b/src/System.Management.Automation/namespaces/Win32Native.cs @@ -27,7 +27,7 @@ namespace Microsoft.PowerShell.Commands.Internal // Remove the default demands for all N/Direct methods with this // global declaration on the class. // - [SuppressUnmanagedCodeSecurityAttribute()] + [SuppressUnmanagedCodeSecurityAttribute] internal static class Win32Native { #region Integer Const diff --git a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs index 8c33c7039b..219c01058e 100644 --- a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs +++ b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs @@ -196,12 +196,12 @@ namespace ExperimentalFeatureTest public class DynamicParamTwo { [Experimental("ExpTest.FeatureOne", ExperimentAction.Show)] - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public string ConfigFile { get; set; } [Experimental("ExpTest.FeatureOne", ExperimentAction.Hide)] - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public string ConfigName { get; set; } }