diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs
index 2488490c514..3a26ca04d41 100644
--- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs
+++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs
@@ -727,6 +727,11 @@ internal bool AtBeginProcess
///
internal CimAsyncOperation AsyncOperation
{
+ get
+ {
+ return this.operation;
+ }
+
set
{
lock (this.myLock)
@@ -735,11 +740,6 @@ internal CimAsyncOperation AsyncOperation
this.operation = value;
}
}
-
- get
- {
- return this.operation;
- }
}
///
diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs
index 559c58b8a11..372c60af0ca 100644
--- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs
+++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs
@@ -309,8 +309,8 @@ private void WaitForAckMessage()
///
internal Cmdlet Cmdlet
{
- set;
get;
+ set;
}
///
@@ -318,8 +318,8 @@ internal Cmdlet Cmdlet
///
internal string TargetComputerName
{
- set;
get;
+ set;
}
#endregion
diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs
index 56e90ad6f8b..1e99f4cda2d 100644
--- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs
+++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs
@@ -540,17 +540,17 @@ private void CreateSetSession(
///
public UInt32 OperationTimeout
{
+ get
+ {
+ return (UInt32)this.options.Timeout.TotalSeconds;
+ }
+
set
{
DebugHelper.WriteLogEx("OperationTimeout {0},", 0, value);
this.options.Timeout = TimeSpan.FromSeconds((double)value);
}
-
- get
- {
- return (UInt32)this.options.Timeout.TotalSeconds;
- }
}
///
@@ -558,17 +558,17 @@ public UInt32 OperationTimeout
///
public Uri ResourceUri
{
+ get
+ {
+ return this.options.ResourceUri;
+ }
+
set
{
DebugHelper.WriteLogEx("ResourceUri {0},", 0, value);
this.options.ResourceUri = value;
}
-
- get
- {
- return this.options.ResourceUri;
- }
}
///
@@ -1595,17 +1595,17 @@ private void DisposeCancelOperation()
///
private IDisposable CancelOperation
{
+ get
+ {
+ return this._cancelOperation;
+ }
+
set
{
DebugHelper.WriteLogEx();
this._cancelOperation = value;
Interlocked.Exchange(ref this._cancelOperationDisposed, 0);
}
-
- get
- {
- return this._cancelOperation;
- }
}
///
@@ -1627,14 +1627,14 @@ internal ProtocolType Protocol
///
internal XOperationContextBase ContextObject
{
- set
+ get
{
- this.contextObject = value;
+ return this.contextObject;
}
- get
+ set
{
- return this.contextObject;
+ this.contextObject = value;
}
}
@@ -1651,14 +1651,14 @@ internal XOperationContextBase ContextObject
///
internal IObjectPreProcess ObjectPreProcess
{
- set
+ get
{
- this.objectPreprocess = value;
+ return this.objectPreprocess;
}
- get
+ set
{
- return this.objectPreprocess;
+ this.objectPreprocess = value;
}
}
diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs
index 7237352b61a..dde2ad53f02 100644
--- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs
+++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs
@@ -279,14 +279,14 @@ public IDictionary Property
[ValidateNotNull]
public SwitchParameter PassThru
{
- set
+ get
{
- this.passThru = value;
+ return this.passThru;
}
- get
+ set
{
- return this.passThru;
+ this.passThru = value;
}
}
diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs
index 86f252fb8fc..36af765eeb8 100644
--- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs
@@ -59,13 +59,13 @@ public long TotalCount
[Alias("Last")]
public int Tail
{
+ get { return _backCount; }
+
set
{
_backCount = value;
_tailSpecified = true;
}
-
- get { return _backCount; }
}
private int _backCount = -1;
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs
index 2ea6d6e20ae..8b3c283fa12 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs
@@ -37,9 +37,9 @@ private static bool HasBeenSpecified(object obj)
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = NotePropertyMultiMemberSet)]
public PSObject InputObject
{
- set { _inputObject = value; }
-
get { return _inputObject; }
+
+ set { _inputObject = value; }
}
private PSMemberTypes _memberType;
@@ -50,9 +50,9 @@ public PSObject InputObject
[Alias("Type")]
public PSMemberTypes MemberType
{
- set { _memberType = value; }
-
get { return _memberType; }
+
+ set { _memberType = value; }
}
private string _memberName;
@@ -62,9 +62,9 @@ public PSMemberTypes MemberType
[Parameter(Mandatory = true, Position = 1, ParameterSetName = "MemberSet")]
public string Name
{
- set { _memberName = value; }
-
get { return _memberName; }
+
+ set { _memberName = value; }
}
private object _value1 = s_notSpecified;
@@ -74,9 +74,9 @@ public string Name
[Parameter(Position = 2, ParameterSetName = "MemberSet")]
public object Value
{
- set { _value1 = value; }
-
get { return _value1; }
+
+ set { _value1 = value; }
}
private object _value2 = s_notSpecified;
@@ -86,9 +86,9 @@ public object Value
[Parameter(Position = 3, ParameterSetName = "MemberSet")]
public object SecondValue
{
- set { _value2 = value; }
-
get { return _value2; }
+
+ set { _value2 = value; }
}
private string _typeName;
@@ -102,9 +102,9 @@ public object SecondValue
[ValidateNotNullOrEmpty]
public string TypeName
{
- set { _typeName = value; }
-
get { return _typeName; }
+
+ set { _typeName = value; }
}
private bool _force;
@@ -116,9 +116,9 @@ public string TypeName
[Parameter(ParameterSetName = NotePropertyMultiMemberSet)]
public SwitchParameter Force
{
- set { _force = value; }
-
get { return _force; }
+
+ set { _force = value; }
}
private bool _passThru /* = false */;
@@ -132,9 +132,9 @@ public SwitchParameter Force
[Parameter(ParameterSetName = NotePropertyMultiMemberSet)]
public SwitchParameter PassThru
{
- set { _passThru = value; }
-
get { return _passThru; }
+
+ set { _passThru = value; }
}
#region Simplifying NoteProperty Declaration
@@ -152,9 +152,9 @@ public SwitchParameter PassThru
[ValidateNotNullOrEmpty]
public string NotePropertyName
{
- set { _notePropertyName = value; }
-
get { return _notePropertyName; }
+
+ set { _notePropertyName = value; }
}
private object _notePropertyValue;
@@ -165,9 +165,9 @@ public string NotePropertyName
[AllowNull]
public object NotePropertyValue
{
- set { _notePropertyValue = value; }
-
get { return _notePropertyValue; }
+
+ set { _notePropertyValue = value; }
}
// Use IDictionary to support both Hashtable and OrderedHashtable
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs
index b95e9968c5c..f8010cfb6b0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs
@@ -88,7 +88,7 @@ public OutGridViewCommand()
/// and if it should be possible to select multiple or single list items.
///
[Parameter(ParameterSetName = "OutputMode")]
- public OutputModeOption OutputMode { set; get; }
+ public OutputModeOption OutputMode { get; set; }
///
/// Gets or sets a value indicating whether the selected items should be written to the pipeline.
@@ -97,9 +97,9 @@ public OutGridViewCommand()
[Parameter(ParameterSetName = "PassThru")]
public SwitchParameter PassThru
{
- set { this.OutputMode = value.IsPresent ? OutputModeOption.Multiple : OutputModeOption.None; }
-
get { return OutputMode == OutputModeOption.Multiple ? new SwitchParameter(true) : new SwitchParameter(false); }
+
+ set { this.OutputMode = value.IsPresent ? OutputModeOption.Multiple : OutputModeOption.None; }
}
#endregion Input Parameters
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs
index daa870d9b1a..dc93637e86c 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs
@@ -65,21 +65,21 @@ public class GetMemberCommand : PSCmdlet
/// The object to retrieve properties from.
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; }
+ public PSObject InputObject { get; set; }
///
/// The member names to be retrieved.
///
[Parameter(Position = 0)]
[ValidateNotNullOrEmpty]
- public string[] Name { set; get; } = new string[] { "*" };
+ public string[] Name { get; set; } = new string[] { "*" };
///
/// The member types to be retrieved.
///
[Parameter]
[Alias("Type")]
- public PSMemberTypes MemberType { set; get; } = PSMemberTypes.All;
+ public PSMemberTypes MemberType { get; set; } = PSMemberTypes.All;
///
/// View from which the members are retrieved.
@@ -94,9 +94,9 @@ public class GetMemberCommand : PSCmdlet
[Parameter]
public SwitchParameter Static
{
- set { _staticParameter = value; }
-
get { return _staticParameter; }
+
+ set { _staticParameter = value; }
}
///
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs
index ea33f7c28d7..e72061468fd 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs
@@ -19,7 +19,7 @@ public sealed class GetUniqueCommand : PSCmdlet
///
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
/// This parameter specifies that objects should be converted to
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
index 2171dd66aec..710a5f32a11 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
@@ -257,9 +257,9 @@ private PSModuleInfo CreateModule(string manifestFile)
[ValidateNotNullOrEmpty]
public new string Prefix
{
- set { base.Prefix = value; }
-
get { return base.Prefix; }
+
+ set { base.Prefix = value; }
}
///
@@ -521,7 +521,7 @@ public string[] FormatTypeName
///
/// This parameter specified a prefix used to modify names of imported commands.
///
- internal string Prefix { set; get; } = string.Empty;
+ internal string Prefix { get; set; } = string.Empty;
///
/// Gets or sets the certificate with which to sign the format file and psm1 file.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
index 230f985c19e..28e544c553c 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
@@ -234,7 +234,7 @@ public MeasureObjectCommand()
///
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
/// Properties to be examined.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
index c2ebc9261a1..fb7d79f4af3 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
@@ -117,7 +117,7 @@ public abstract class ObjectBase : ObjectCmdletBase
///
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
/// Gets or Sets the Properties that would be used for Grouping, Sorting and Comparison.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs
index bba2ac2873d..8e90235196b 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs
@@ -76,7 +76,7 @@ public sealed class SelectObjectCommand : PSCmdlet
///
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
///
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs
index d7071a06605..9ad21d5e84d 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs
@@ -25,13 +25,13 @@ public sealed class MeasureCommandCommand : PSCmdlet
/// This parameter specifies the current pipeline object.
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
/// The script block to apply.
///
[Parameter(Position = 0, Mandatory = true)]
- public ScriptBlock Expression { set; get; }
+ public ScriptBlock Expression { get; set; }
#endregion
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs
index d19810522d0..0565d6d7d41 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs
@@ -24,14 +24,14 @@ public class UpdateData : PSCmdlet
ParameterSetName = FileParameterSet)]
[Alias("PSPath", "Path")]
[ValidateNotNull]
- public string[] AppendPath { set; get; } = Array.Empty();
+ public string[] AppendPath { get; set; } = Array.Empty();
///
/// Files to prepend to the existing set.
///
[Parameter(ParameterSetName = FileParameterSet)]
[ValidateNotNull]
- public string[] PrependPath { set; get; } = Array.Empty();
+ public string[] PrependPath { get; set; } = Array.Empty();
private static void ReportWrongExtension(string file, string errorId, PSCmdlet cmdlet)
{
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 de7d2590176..a791ff2ed84 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs
@@ -50,13 +50,13 @@ private static bool HasBeenSpecified(object obj)
System.Management.Automation.Runspaces.TypeData.CodeMethod, IgnoreCase = true)]
public PSMemberTypes MemberType
{
+ get { return _memberType; }
+
set
{
_memberType = value;
_isMemberTypeSet = true;
}
-
- get { return _memberType; }
}
private string _memberName;
@@ -67,9 +67,9 @@ public PSMemberTypes MemberType
[ValidateNotNullOrEmpty]
public string MemberName
{
- set { _memberName = value; }
-
get { return _memberName; }
+
+ set { _memberName = value; }
}
private object _value1 = s_notSpecified;
@@ -80,9 +80,9 @@ public string MemberName
[Parameter(ParameterSetName = DynamicTypeSet)]
public object Value
{
- set { _value1 = value; }
-
get { return _value1; }
+
+ set { _value1 = value; }
}
private object _value2;
@@ -94,9 +94,9 @@ public object Value
[ValidateNotNull]
public object SecondValue
{
- set { _value2 = value; }
-
get { return _value2; }
+
+ set { _value2 = value; }
}
private Type _typeConverter;
@@ -107,9 +107,9 @@ public object SecondValue
[ValidateNotNull]
public Type TypeConverter
{
- set { _typeConverter = value; }
-
get { return _typeConverter; }
+
+ set { _typeConverter = value; }
}
private Type _typeAdapter;
@@ -120,9 +120,9 @@ public Type TypeConverter
[ValidateNotNull]
public Type TypeAdapter
{
- set { _typeAdapter = value; }
-
get { return _typeAdapter; }
+
+ set { _typeAdapter = value; }
}
///
@@ -132,9 +132,9 @@ public Type TypeAdapter
[ValidateNotNullOrEmpty]
public string SerializationMethod
{
- set { _serializationMethod = value; }
-
get { return _serializationMethod; }
+
+ set { _serializationMethod = value; }
}
///
@@ -144,9 +144,9 @@ public string SerializationMethod
[ValidateNotNull]
public Type TargetTypeForDeserialization
{
- set { _targetTypeForDeserialization = value; }
-
get { return _targetTypeForDeserialization; }
+
+ set { _targetTypeForDeserialization = value; }
}
///
@@ -157,9 +157,9 @@ public Type TargetTypeForDeserialization
[ValidateRange(0, int.MaxValue)]
public int SerializationDepth
{
- set { _serializationDepth = value; }
-
get { return _serializationDepth; }
+
+ set { _serializationDepth = value; }
}
///
@@ -169,9 +169,9 @@ public int SerializationDepth
[ValidateNotNullOrEmpty]
public string DefaultDisplayProperty
{
- set { _defaultDisplayProperty = value; }
-
get { return _defaultDisplayProperty; }
+
+ set { _defaultDisplayProperty = value; }
}
///
@@ -181,9 +181,9 @@ public string DefaultDisplayProperty
[ValidateNotNull]
public bool? InheritPropertySerializationSet
{
- set { _inheritPropertySerializationSet = value; }
-
get { return _inheritPropertySerializationSet; }
+
+ set { _inheritPropertySerializationSet = value; }
}
///
@@ -193,9 +193,9 @@ public bool? InheritPropertySerializationSet
[ValidateNotNullOrEmpty]
public string StringSerializationSource
{
- set { _stringSerializationSource = value; }
-
get { return _stringSerializationSource; }
+
+ set { _stringSerializationSource = value; }
}
///
@@ -206,9 +206,9 @@ public string StringSerializationSource
[ValidateNotNullOrEmpty]
public string[] DefaultDisplayPropertySet
{
- set { _defaultDisplayPropertySet = value; }
-
get { return _defaultDisplayPropertySet; }
+
+ set { _defaultDisplayPropertySet = value; }
}
///
@@ -219,9 +219,9 @@ public string[] DefaultDisplayPropertySet
[ValidateNotNullOrEmpty]
public string[] DefaultKeyPropertySet
{
- set { _defaultKeyPropertySet = value; }
-
get { return _defaultKeyPropertySet; }
+
+ set { _defaultKeyPropertySet = value; }
}
///
@@ -232,9 +232,9 @@ public string[] DefaultKeyPropertySet
[ValidateNotNullOrEmpty]
public string[] PropertySerializationSet
{
- set { _propertySerializationSet = value; }
-
get { return _propertySerializationSet; }
+
+ set { _propertySerializationSet = value; }
}
// These members are represented as NoteProperty in types.ps1xml
@@ -261,9 +261,9 @@ public string[] PropertySerializationSet
[ValidateNotNullOrEmpty]
public string TypeName
{
- set { _typeName = value; }
-
get { return _typeName; }
+
+ set { _typeName = value; }
}
private bool _force = false;
@@ -274,9 +274,9 @@ public string TypeName
[Parameter(ParameterSetName = TypeDataSet)]
public SwitchParameter Force
{
- set { _force = value; }
-
get { return _force; }
+
+ set { _force = value; }
}
#endregion dynamic type set
@@ -291,9 +291,9 @@ public SwitchParameter Force
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, ParameterSetName = TypeDataSet)]
public TypeData[] TypeData
{
- set { _typeData = value; }
-
get { return _typeData; }
+
+ set { _typeData = value; }
}
#endregion strong type data set
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs
index 04e35a9018d..9fe7553193e 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs
@@ -27,7 +27,7 @@ public class TraceCommandCommand : TraceListenerCommandBase, IDisposable
/// This parameter specifies the current pipeline object.
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
/// The TraceSource parameter determines which TraceSource categories the
diff --git a/src/Microsoft.WSMan.Management/Interop.cs b/src/Microsoft.WSMan.Management/Interop.cs
index 6e813ef17e1..7084a111f2d 100644
--- a/src/Microsoft.WSMan.Management/Interop.cs
+++ b/src/Microsoft.WSMan.Management/Interop.cs
@@ -734,19 +734,18 @@ public interface IWSManResourceLocator
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
string ResourceUri
{
- // IDL: HRESULT resourceUri (BSTR value);
+ // IDL: HRESULT resourceUri ([out, retval] BSTR* ReturnValue);
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
[DispId(1)]
- set;
-
- // IDL: HRESULT resourceUri ([out, retval] BSTR* ReturnValue);
+ [return: MarshalAs(UnmanagedType.BStr)]
+ get;
+ // IDL: HRESULT resourceUri (BSTR value);
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
[DispId(1)]
- [return: MarshalAs(UnmanagedType.BStr)]
- get;
+ set;
}
/// AddSelector method of IWSManResourceLocator interface. Add selector to resource locator
diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs
index e03b4ae61eb..3733b0cf310 100644
--- a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs
+++ b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs
@@ -150,7 +150,7 @@ public abstract class FrontEndCommandBase : PSCmdlet, IDisposable
/// This parameter specifies the current pipeline object.
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
#endregion
diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs
index bb8305b2fdc..41d1d2d6d59 100644
--- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs
+++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs
@@ -596,9 +596,9 @@ private void ProcessOutOfBandPayload(FormatEntryData fed)
internal LineOutput LineOutput
{
- set { _lo = value; }
-
get { return _lo; }
+
+ set { _lo = value; }
}
private ShapeInfo ShapeInfoOnFormatContext
diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs
index 64d59dbc83e..717ea07bdcd 100644
--- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs
+++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs
@@ -102,6 +102,13 @@ internal sealed class DefaultSettingsSection
{
internal bool MultilineTables
{
+ get
+ {
+ if (_multilineTables.HasValue)
+ return _multilineTables.Value;
+ return false;
+ }
+
set
{
if (!_multilineTables.HasValue)
@@ -109,13 +116,6 @@ internal bool MultilineTables
_multilineTables = value;
}
}
-
- get
- {
- if (_multilineTables.HasValue)
- return _multilineTables.Value;
- return false;
- }
}
private bool? _multilineTables;
@@ -132,6 +132,13 @@ internal sealed class FormatErrorPolicy
///
internal bool ShowErrorsAsMessages
{
+ get
+ {
+ if (_showErrorsAsMessages.HasValue)
+ return _showErrorsAsMessages.Value;
+ return false;
+ }
+
set
{
if (!_showErrorsAsMessages.HasValue)
@@ -139,13 +146,6 @@ internal bool ShowErrorsAsMessages
_showErrorsAsMessages = value;
}
}
-
- get
- {
- if (_showErrorsAsMessages.HasValue)
- return _showErrorsAsMessages.Value;
- return false;
- }
}
private bool? _showErrorsAsMessages;
@@ -156,6 +156,13 @@ internal bool ShowErrorsAsMessages
///
internal bool ShowErrorsInFormattedOutput
{
+ get
+ {
+ if (_showErrorsInFormattedOutput.HasValue)
+ return _showErrorsInFormattedOutput.Value;
+ return false;
+ }
+
set
{
if (!_showErrorsInFormattedOutput.HasValue)
@@ -163,13 +170,6 @@ internal bool ShowErrorsInFormattedOutput
_showErrorsInFormattedOutput = value;
}
}
-
- get
- {
- if (_showErrorsInFormattedOutput.HasValue)
- return _showErrorsInFormattedOutput.Value;
- return false;
- }
}
private bool? _showErrorsInFormattedOutput;
@@ -191,6 +191,13 @@ internal sealed class ShapeSelectionDirectives
{
internal int PropertyCountForTable
{
+ get
+ {
+ if (_propertyCountForTable.HasValue)
+ return _propertyCountForTable.Value;
+ return 4;
+ }
+
set
{
if (!_propertyCountForTable.HasValue)
@@ -198,13 +205,6 @@ internal int PropertyCountForTable
_propertyCountForTable = value;
}
}
-
- get
- {
- if (_propertyCountForTable.HasValue)
- return _propertyCountForTable.Value;
- return 4;
- }
}
private int? _propertyCountForTable;
diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs
index edf9e5ef8f1..2582a1e68db 100644
--- a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs
+++ b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs
@@ -22,7 +22,7 @@ public class OutNullCommand : PSCmdlet
/// This parameter specifies the current pipeline object.
///
[Parameter(ValueFromPipeline = true)]
- public PSObject InputObject { set; get; } = AutomationNull.Value;
+ public PSObject InputObject { get; set; } = AutomationNull.Value;
///
/// Do nothing.
diff --git a/src/System.Management.Automation/engine/Attributes.cs b/src/System.Management.Automation/engine/Attributes.cs
index 16445703030..a43ab1d9411 100644
--- a/src/System.Management.Automation/engine/Attributes.cs
+++ b/src/System.Management.Automation/engine/Attributes.cs
@@ -1265,7 +1265,7 @@ public sealed class ValidatePatternAttribute : ValidateEnumeratedArgumentsAttrib
///
/// Gets or sets the Regex options to be used in the validation.
///
- public RegexOptions Options { set; get; } = RegexOptions.IgnoreCase;
+ public RegexOptions Options { get; set; } = RegexOptions.IgnoreCase;
///
/// Gets or sets the custom error message pattern that is displayed to the user.
diff --git a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs
index 09a933eaad2..c4f03ead600 100644
--- a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs
+++ b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs
@@ -30,7 +30,7 @@ public DefaultCommandRuntime(List