Fix accessor order (#13538)

* Fix Microsoft.PowerShell.Commands.Utility

* Fix System.Management.Automation

* Fix Microsoft.Management.Infrastructure.CimCmdlets

* Fix Microsoft.PowerShell.Commands.Management

* Fix Microsoft.WSMan.Management
This commit is contained in:
xtqqczze
2020-11-05 10:05:50 +05:00
committed by GitHub
parent 3ba61069b8
commit eaad6c2235
43 changed files with 219 additions and 220 deletions
@@ -63,9 +63,9 @@ namespace Microsoft.PowerShell.Commands
[Parameter]
public SwitchParameter Global
{
set { base.BaseGlobal = value; }
get { return base.BaseGlobal; }
set { base.BaseGlobal = value; }
}
/// <summary>
@@ -75,9 +75,9 @@ namespace Microsoft.PowerShell.Commands
[ValidateNotNull]
public string Prefix
{
set { BasePrefix = value; }
get { return BasePrefix; }
set { BasePrefix = value; }
}
/// <summary>
@@ -89,7 +89,7 @@ namespace Microsoft.PowerShell.Commands
[Parameter(ParameterSetName = ParameterSet_ViaWinCompat, Mandatory = true, ValueFromPipeline = true, Position = 0)]
[ValidateTrustedData]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] Name { set; get; } = Array.Empty<string>();
public string[] Name { get; set; } = Array.Empty<string>();
/// <summary>
/// This parameter specifies the current pipeline object.
@@ -117,6 +117,8 @@ namespace Microsoft.PowerShell.Commands
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] Function
{
get { return _functionImportList; }
set
{
if (value == null)
@@ -130,8 +132,6 @@ namespace Microsoft.PowerShell.Commands
BaseFunctionPatterns.Add(WildcardPattern.Get(pattern, WildcardOptions.IgnoreCase));
}
}
get { return _functionImportList; }
}
private string[] _functionImportList = Array.Empty<string>();
@@ -144,6 +144,8 @@ namespace Microsoft.PowerShell.Commands
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] Cmdlet
{
get { return _cmdletImportList; }
set
{
if (value == null)
@@ -158,8 +160,6 @@ namespace Microsoft.PowerShell.Commands
BaseCmdletPatterns.Add(WildcardPattern.Get(pattern, WildcardOptions.IgnoreCase));
}
}
get { return _cmdletImportList; }
}
private string[] _cmdletImportList = Array.Empty<string>();
@@ -172,6 +172,8 @@ namespace Microsoft.PowerShell.Commands
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] Variable
{
get { return _variableExportList; }
set
{
if (value == null)
@@ -185,8 +187,6 @@ namespace Microsoft.PowerShell.Commands
BaseVariablePatterns.Add(WildcardPattern.Get(pattern, WildcardOptions.IgnoreCase));
}
}
get { return _variableExportList; }
}
private string[] _variableExportList;
@@ -199,6 +199,8 @@ namespace Microsoft.PowerShell.Commands
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] Alias
{
get { return _aliasExportList; }
set
{
if (value == null)
@@ -213,8 +215,6 @@ namespace Microsoft.PowerShell.Commands
BaseAliasPatterns.Add(WildcardPattern.Get(pattern, WildcardOptions.IgnoreCase));
}
}
get { return _aliasExportList; }
}
private string[] _aliasExportList;
@@ -335,7 +335,7 @@ namespace Microsoft.PowerShell.Commands
[Parameter(ParameterSetName = ParameterSet_ModuleInfo, Mandatory = true, ValueFromPipeline = true, Position = 0)]
[ValidateTrustedData]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public PSModuleInfo[] ModuleInfo { set; get; } = Array.Empty<PSModuleInfo>();
public PSModuleInfo[] ModuleInfo { get; set; } = Array.Empty<PSModuleInfo>();
/// <summary>
/// The arguments to pass to the module script.