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 529687db68f..78c3595367a 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs
@@ -18,7 +18,7 @@ public abstract class MeasureInfo
///
/// Property name.
///
- public string Property { get; set; } = null;
+ public string Property { get; set; }
}
///
@@ -244,7 +244,7 @@ public MeasureObjectCommand()
///
[ValidateNotNullOrEmpty]
[Parameter(Position = 0)]
- public PSPropertyExpression[] Property { get; set; } = null;
+ public PSPropertyExpression[] Property { get; set; }
#endregion Common parameters in both sets
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs
index b40b53952f0..c067615f3c0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs
@@ -34,7 +34,7 @@ public sealed class NewObjectCommand : PSCmdlet
/// the number
[Parameter(ParameterSetName = netSetName, Mandatory = true, Position = 0)]
[ValidateTrustedData]
- public string TypeName { get; set; } = null;
+ public string TypeName { get; set; }
#if !UNIX
private Guid _comObjectClsId = Guid.Empty;
@@ -43,7 +43,7 @@ public sealed class NewObjectCommand : PSCmdlet
///
[Parameter(ParameterSetName = "Com", Mandatory = true, Position = 0)]
[ValidateTrustedData]
- public string ComObject { get; set; } = null;
+ public string ComObject { get; set; }
#endif
///
@@ -53,7 +53,7 @@ public sealed class NewObjectCommand : PSCmdlet
[Parameter(ParameterSetName = netSetName, Mandatory = false, Position = 1)]
[ValidateTrustedData]
[Alias("Args")]
- public object[] ArgumentList { get; set; } = null;
+ public object[] ArgumentList { get; set; }
///
/// True if we should have an error when Com objects will use an interop assembly.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs
index 0e633ca5b2e..53c39250763 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs
@@ -68,25 +68,25 @@ public DateTime End
/// Allows the user to override the day.
///
[Parameter(ParameterSetName = "Time")]
- public int Days { get; set; } = 0;
+ public int Days { get; set; }
///
/// Allows the user to override the hour.
///
[Parameter(ParameterSetName = "Time")]
- public int Hours { get; set; } = 0;
+ public int Hours { get; set; }
///
/// Allows the user to override the minute.
///
[Parameter(ParameterSetName = "Time")]
- public int Minutes { get; set; } = 0;
+ public int Minutes { get; set; }
///
/// Allows the user to override the second.
///
[Parameter(ParameterSetName = "Time")]
- public int Seconds { get; set; } = 0;
+ public int Seconds { get; set; }
#endregion
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
index b3f768f1a65..0e00de90d52 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs
@@ -182,9 +182,9 @@ internal sealed class OrderByProperty
///
/// A logical matrix where each row is an input object and its property values specified by Properties.
///
- internal List OrderMatrix { get; } = null;
+ internal List OrderMatrix { get; }
- internal OrderByPropertyComparer Comparer { get; } = null;
+ internal OrderByPropertyComparer Comparer { get; }
internal List MshParameterList
{
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 4fd27e4d007..0144812e9e0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs
@@ -91,14 +91,14 @@ public sealed class SelectObjectCommand : PSCmdlet
///
[Parameter(ParameterSetName = "DefaultParameter")]
[Parameter(ParameterSetName = "SkipLastParameter")]
- public string[] ExcludeProperty { get; set; } = null;
+ public string[] ExcludeProperty { get; set; }
///
///
///
[Parameter(ParameterSetName = "DefaultParameter")]
[Parameter(ParameterSetName = "SkipLastParameter")]
- public string ExpandProperty { get; set; } = null;
+ public string ExpandProperty { get; set; }
///
///
@@ -152,14 +152,14 @@ public int First
///
[Parameter(ParameterSetName = "DefaultParameter")]
[ValidateRange(0, int.MaxValue)]
- public int Skip { get; set; } = 0;
+ public int Skip { get; set; }
///
/// Skip the specified number of items from end.
///
[Parameter(ParameterSetName = "SkipLastParameter")]
[ValidateRange(0, int.MaxValue)]
- public int SkipLast { get; set; } = 0;
+ public int SkipLast { get; set; }
///
/// With this switch present, the cmdlet won't "short-circuit"
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Sort-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Sort-Object.cs
index 5f66b39753f..6ccc30dcf7f 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Sort-Object.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Sort-Object.cs
@@ -53,14 +53,14 @@ public SwitchParameter Descending
///
[Parameter(ParameterSetName = "Top", Mandatory = true)]
[ValidateRange(1, int.MaxValue)]
- public int Top { get; set; } = 0;
+ public int Top { get; set; }
///
/// Gets or sets the number of items to return in a Bottom N sort.
///
[Parameter(ParameterSetName = "Bottom", Mandatory = true)]
[ValidateRange(1, int.MaxValue)]
- public int Bottom { get; set; } = 0;
+ public int Bottom { get; set; }
///
/// Moves unique entries to the front of the list.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
index f540fa67636..6102a66625d 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
@@ -239,7 +239,7 @@ public virtual int MaximumRedirection
///
[Parameter]
[ValidateRange(0, Int32.MaxValue)]
- public virtual int MaximumRetryCount { get; set; } = 0;
+ public virtual int MaximumRetryCount { get; set; }
///
/// Gets or sets the RetryIntervalSec property, which determines the number seconds between retries.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs
index c812d47ec7f..baf18faac4f 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs
@@ -21,7 +21,7 @@ public sealed class WriteDebugCommand : PSCmdlet
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyString]
[Alias("Msg")]
- public string Message { get; set; } = null;
+ public string Message { get; set; }
///
/// This method implements the ProcessRecord method for Write-Debug command.
@@ -69,7 +69,7 @@ public sealed class WriteVerboseCommand : PSCmdlet
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyString]
[Alias("Msg")]
- public string Message { get; set; } = null;
+ public string Message { get; set; }
///
/// This method implements the ProcessRecord method for Write-verbose command.
@@ -117,7 +117,7 @@ public sealed class WriteWarningCommand : PSCmdlet
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyString]
[Alias("Msg")]
- public string Message { get; set; } = null;
+ public string Message { get; set; }
///
/// This method implements the ProcessRecord method for Write-Warning command.
@@ -215,7 +215,7 @@ public class WriteOrThrowErrorCommand : PSCmdlet
/// ErrorRecord.Exception -- if not specified, ErrorRecord.Exception is System.Exception.
///
[Parameter(ParameterSetName = "WithException", Mandatory = true)]
- public Exception Exception { get; set; } = null;
+ public Exception Exception { get; set; }
///
/// If Exception is specified, this is ErrorRecord.ErrorDetails.Message;
@@ -226,14 +226,14 @@ public class WriteOrThrowErrorCommand : PSCmdlet
[AllowNull]
[AllowEmptyString]
[Alias("Msg")]
- public string Message { get; set; } = null;
+ public string Message { get; set; }
///
/// If Exception is specified, this is ErrorRecord.ErrorDetails.Message;
/// otherwise, the Exception is System.Exception, and this is Exception.Message.
///
[Parameter(ParameterSetName = "ErrorRecord", Mandatory = true)]
- public ErrorRecord ErrorRecord { get; set; } = null;
+ public ErrorRecord ErrorRecord { get; set; }
///
/// ErrorRecord.CategoryInfo.Category.
@@ -254,7 +254,7 @@ public class WriteOrThrowErrorCommand : PSCmdlet
///
[Parameter(ParameterSetName = "NoException")]
[Parameter(ParameterSetName = "WithException")]
- public object TargetObject { get; set; } = null;
+ public object TargetObject { get; set; }
///
/// ErrorRecord.ErrorDetails.RecommendedAction.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs
index 6bfad511406..e9a1018459d 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs
@@ -18,7 +18,7 @@ public sealed class WriteHostCommand : ConsoleColorCmdlet
///
[Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)]
[Alias("Msg", "Message")]
- public object Object { get; set; } = null;
+ public object Object { get; set; }
///
/// False to add a newline to the end of the output string, true if not.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs
index 93a1c392c11..2135ffa99d3 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs
@@ -37,7 +37,7 @@ public sealed class WriteProgressCommand : PSCmdlet
///
[Parameter(Position = 2)]
[ValidateRange(0, Int32.MaxValue)]
- public int Id { get; set; } = 0;
+ public int Id { get; set; }
///
/// Percentage completion of the activity, or -1 if n/a.
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs
index 0e86cdbfa18..c0093bd6959 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs
@@ -32,7 +32,7 @@ public sealed class ExportClixmlCommand : PSCmdlet, IDisposable
///
[Parameter]
[ValidateRange(1, int.MaxValue)]
- public int Depth { get; set; } = 0;
+ public int Depth { get; set; }
///
/// Mandatory file name to write to.
@@ -388,7 +388,7 @@ public sealed class ConvertToXmlCommand : PSCmdlet, IDisposable
///
[Parameter(HelpMessage = "Specifies how many levels of contained objects should be included in the XML representation")]
[ValidateRange(1, int.MaxValue)]
- public int Depth { get; set; } = 0;
+ public int Depth { get; set; }
///
/// Input Object which is written to XML format.